feat: port influx auth command (#152)
This commit is contained in:
920
api/api_authorizations.gen.go
Normal file
920
api/api_authorizations.gen.go
Normal file
@ -0,0 +1,920 @@
|
||||
/*
|
||||
* Subset of Influx API covered by Influx CLI
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 2.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
_context "context"
|
||||
_fmt "fmt"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
var (
|
||||
_ _context.Context
|
||||
)
|
||||
|
||||
type AuthorizationsApi interface {
|
||||
|
||||
/*
|
||||
* DeleteAuthorizationsID Delete an authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to delete.
|
||||
* @return ApiDeleteAuthorizationsIDRequest
|
||||
*/
|
||||
DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest
|
||||
|
||||
/*
|
||||
* DeleteAuthorizationsIDExecute executes the request
|
||||
*/
|
||||
DeleteAuthorizationsIDExecute(r ApiDeleteAuthorizationsIDRequest) error
|
||||
|
||||
/*
|
||||
* GetAuthorizations List all authorizations
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiGetAuthorizationsRequest
|
||||
*/
|
||||
GetAuthorizations(ctx _context.Context) ApiGetAuthorizationsRequest
|
||||
|
||||
/*
|
||||
* GetAuthorizationsExecute executes the request
|
||||
* @return Authorizations
|
||||
*/
|
||||
GetAuthorizationsExecute(r ApiGetAuthorizationsRequest) (Authorizations, error)
|
||||
|
||||
/*
|
||||
* GetAuthorizationsID Retrieve an authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to get.
|
||||
* @return ApiGetAuthorizationsIDRequest
|
||||
*/
|
||||
GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest
|
||||
|
||||
/*
|
||||
* GetAuthorizationsIDExecute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
GetAuthorizationsIDExecute(r ApiGetAuthorizationsIDRequest) (Authorization, error)
|
||||
|
||||
/*
|
||||
* PatchAuthorizationsID Update an authorization to be active or inactive
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to update.
|
||||
* @return ApiPatchAuthorizationsIDRequest
|
||||
*/
|
||||
PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest
|
||||
|
||||
/*
|
||||
* PatchAuthorizationsIDExecute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
PatchAuthorizationsIDExecute(r ApiPatchAuthorizationsIDRequest) (Authorization, error)
|
||||
|
||||
/*
|
||||
* PostAuthorizations Create an authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiPostAuthorizationsRequest
|
||||
*/
|
||||
PostAuthorizations(ctx _context.Context) ApiPostAuthorizationsRequest
|
||||
|
||||
/*
|
||||
* PostAuthorizationsExecute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
PostAuthorizationsExecute(r ApiPostAuthorizationsRequest) (Authorization, error)
|
||||
|
||||
// Sets additional descriptive text in the error message if any request in
|
||||
// this API fails, indicating that it is intended to be used only on OSS
|
||||
// servers.
|
||||
OnlyOSS() AuthorizationsApi
|
||||
|
||||
// Sets additional descriptive text in the error message if any request in
|
||||
// this API fails, indicating that it is intended to be used only on cloud
|
||||
// servers.
|
||||
OnlyCloud() AuthorizationsApi
|
||||
}
|
||||
|
||||
// AuthorizationsApiService AuthorizationsApi service
|
||||
type AuthorizationsApiService service
|
||||
|
||||
func (a *AuthorizationsApiService) OnlyOSS() AuthorizationsApi {
|
||||
a.isOnlyOSS = true
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AuthorizationsApiService) OnlyCloud() AuthorizationsApi {
|
||||
a.isOnlyCloud = true
|
||||
return a
|
||||
}
|
||||
|
||||
type ApiDeleteAuthorizationsIDRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService AuthorizationsApi
|
||||
authID string
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiDeleteAuthorizationsIDRequest) AuthID(authID string) ApiDeleteAuthorizationsIDRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiDeleteAuthorizationsIDRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiDeleteAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiDeleteAuthorizationsIDRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiDeleteAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiDeleteAuthorizationsIDRequest) Execute() error {
|
||||
return r.ApiService.DeleteAuthorizationsIDExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* DeleteAuthorizationsID Delete an authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to delete.
|
||||
* @return ApiDeleteAuthorizationsIDRequest
|
||||
*/
|
||||
func (a *AuthorizationsApiService) DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest {
|
||||
return ApiDeleteAuthorizationsIDRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute executes the request
|
||||
*/
|
||||
func (a *AuthorizationsApiService) DeleteAuthorizationsIDExecute(r ApiDeleteAuthorizationsIDRequest) error {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.DeleteAuthorizationsID")
|
||||
if err != nil {
|
||||
return GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/authorizations/{authID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"authID"+"}", _neturl.PathEscape(parameterToString(r.authID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.zapTraceSpan != nil {
|
||||
localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var errorPrefix string
|
||||
if a.isOnlyOSS {
|
||||
errorPrefix = "InfluxDB OSS-only command failed: "
|
||||
} else if a.isOnlyCloud {
|
||||
errorPrefix = "InfluxDB Cloud-only command failed: "
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
|
||||
}
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
|
||||
return newErr
|
||||
}
|
||||
newErr.model = &v
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
|
||||
return newErr
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type ApiGetAuthorizationsRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService AuthorizationsApi
|
||||
zapTraceSpan *string
|
||||
userID *string
|
||||
user *string
|
||||
orgID *string
|
||||
org *string
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiGetAuthorizationsRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) UserID(userID string) ApiGetAuthorizationsRequest {
|
||||
r.userID = &userID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetUserID() *string {
|
||||
return r.userID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) User(user string) ApiGetAuthorizationsRequest {
|
||||
r.user = &user
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetUser() *string {
|
||||
return r.user
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) OrgID(orgID string) ApiGetAuthorizationsRequest {
|
||||
r.orgID = &orgID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetOrgID() *string {
|
||||
return r.orgID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) Org(org string) ApiGetAuthorizationsRequest {
|
||||
r.org = &org
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetOrg() *string {
|
||||
return r.org
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) Execute() (Authorizations, error) {
|
||||
return r.ApiService.GetAuthorizationsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* GetAuthorizations List all authorizations
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiGetAuthorizationsRequest
|
||||
*/
|
||||
func (a *AuthorizationsApiService) GetAuthorizations(ctx _context.Context) ApiGetAuthorizationsRequest {
|
||||
return ApiGetAuthorizationsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute executes the request
|
||||
* @return Authorizations
|
||||
*/
|
||||
func (a *AuthorizationsApiService) GetAuthorizationsExecute(r ApiGetAuthorizationsRequest) (Authorizations, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Authorizations
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.GetAuthorizations")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/authorizations"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
if r.userID != nil {
|
||||
localVarQueryParams.Add("userID", parameterToString(*r.userID, ""))
|
||||
}
|
||||
if r.user != nil {
|
||||
localVarQueryParams.Add("user", parameterToString(*r.user, ""))
|
||||
}
|
||||
if r.orgID != nil {
|
||||
localVarQueryParams.Add("orgID", parameterToString(*r.orgID, ""))
|
||||
}
|
||||
if r.org != nil {
|
||||
localVarQueryParams.Add("org", parameterToString(*r.org, ""))
|
||||
}
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.zapTraceSpan != nil {
|
||||
localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
var errorPrefix string
|
||||
if a.isOnlyOSS {
|
||||
errorPrefix = "InfluxDB OSS-only command failed: "
|
||||
} else if a.isOnlyCloud {
|
||||
errorPrefix = "InfluxDB Cloud-only command failed: "
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
|
||||
}
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
newErr.model = &v
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
|
||||
}
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiGetAuthorizationsIDRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService AuthorizationsApi
|
||||
authID string
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsIDRequest) AuthID(authID string) ApiGetAuthorizationsIDRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsIDRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiGetAuthorizationsIDRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsIDRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.GetAuthorizationsIDExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* GetAuthorizationsID Retrieve an authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to get.
|
||||
* @return ApiGetAuthorizationsIDRequest
|
||||
*/
|
||||
func (a *AuthorizationsApiService) GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest {
|
||||
return ApiGetAuthorizationsIDRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
func (a *AuthorizationsApiService) GetAuthorizationsIDExecute(r ApiGetAuthorizationsIDRequest) (Authorization, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Authorization
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.GetAuthorizationsID")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/authorizations/{authID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"authID"+"}", _neturl.PathEscape(parameterToString(r.authID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.zapTraceSpan != nil {
|
||||
localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
var errorPrefix string
|
||||
if a.isOnlyOSS {
|
||||
errorPrefix = "InfluxDB OSS-only command failed: "
|
||||
} else if a.isOnlyCloud {
|
||||
errorPrefix = "InfluxDB Cloud-only command failed: "
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
|
||||
}
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
newErr.model = &v
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
|
||||
}
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiPatchAuthorizationsIDRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService AuthorizationsApi
|
||||
authID string
|
||||
authorizationUpdateRequest *AuthorizationUpdateRequest
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) AuthID(authID string) ApiPatchAuthorizationsIDRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiPatchAuthorizationsIDRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) AuthorizationUpdateRequest(authorizationUpdateRequest AuthorizationUpdateRequest) ApiPatchAuthorizationsIDRequest {
|
||||
r.authorizationUpdateRequest = &authorizationUpdateRequest
|
||||
return r
|
||||
}
|
||||
func (r ApiPatchAuthorizationsIDRequest) GetAuthorizationUpdateRequest() *AuthorizationUpdateRequest {
|
||||
return r.authorizationUpdateRequest
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiPatchAuthorizationsIDRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiPatchAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.PatchAuthorizationsIDExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* PatchAuthorizationsID Update an authorization to be active or inactive
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to update.
|
||||
* @return ApiPatchAuthorizationsIDRequest
|
||||
*/
|
||||
func (a *AuthorizationsApiService) PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest {
|
||||
return ApiPatchAuthorizationsIDRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
func (a *AuthorizationsApiService) PatchAuthorizationsIDExecute(r ApiPatchAuthorizationsIDRequest) (Authorization, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Authorization
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.PatchAuthorizationsID")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/authorizations/{authID}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"authID"+"}", _neturl.PathEscape(parameterToString(r.authID, "")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
if r.authorizationUpdateRequest == nil {
|
||||
return localVarReturnValue, reportError("authorizationUpdateRequest is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.zapTraceSpan != nil {
|
||||
localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "")
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.authorizationUpdateRequest
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
var errorPrefix string
|
||||
if a.isOnlyOSS {
|
||||
errorPrefix = "InfluxDB OSS-only command failed: "
|
||||
} else if a.isOnlyCloud {
|
||||
errorPrefix = "InfluxDB Cloud-only command failed: "
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
|
||||
}
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
newErr.model = &v
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
|
||||
}
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiPostAuthorizationsRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService AuthorizationsApi
|
||||
authorizationPostRequest *AuthorizationPostRequest
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsRequest) AuthorizationPostRequest(authorizationPostRequest AuthorizationPostRequest) ApiPostAuthorizationsRequest {
|
||||
r.authorizationPostRequest = &authorizationPostRequest
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsRequest) GetAuthorizationPostRequest() *AuthorizationPostRequest {
|
||||
return r.authorizationPostRequest
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiPostAuthorizationsRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.PostAuthorizationsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* PostAuthorizations Create an authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiPostAuthorizationsRequest
|
||||
*/
|
||||
func (a *AuthorizationsApiService) PostAuthorizations(ctx _context.Context) ApiPostAuthorizationsRequest {
|
||||
return ApiPostAuthorizationsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
func (a *AuthorizationsApiService) PostAuthorizationsExecute(r ApiPostAuthorizationsRequest) (Authorization, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Authorization
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthorizationsApiService.PostAuthorizations")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/authorizations"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := _neturl.Values{}
|
||||
localVarFormParams := _neturl.Values{}
|
||||
if r.authorizationPostRequest == nil {
|
||||
return localVarReturnValue, reportError("authorizationPostRequest is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.zapTraceSpan != nil {
|
||||
localVarHeaderParams["Zap-Trace-Span"] = parameterToString(*r.zapTraceSpan, "")
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.authorizationPostRequest
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, err
|
||||
}
|
||||
|
||||
var errorPrefix string
|
||||
if a.isOnlyOSS {
|
||||
errorPrefix = "InfluxDB OSS-only command failed: "
|
||||
} else if a.isOnlyCloud {
|
||||
errorPrefix = "InfluxDB Cloud-only command failed: "
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, localVarHTTPResponse.Status),
|
||||
}
|
||||
if localVarHTTPResponse.StatusCode == 400 {
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
newErr.model = &v
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
var v Error
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, err.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
newErr.model = &v
|
||||
newErr.error = _fmt.Sprintf("%s%v", errorPrefix, v.Error())
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
body, err := GunzipIfNeeded(localVarHTTPResponse)
|
||||
if err != nil {
|
||||
body.Close()
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
localVarBody, err := _ioutil.ReadAll(body)
|
||||
body.Close()
|
||||
if err != nil {
|
||||
return localVarReturnValue, _fmt.Errorf("%s%w", errorPrefix, err)
|
||||
}
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: _fmt.Sprintf("%s%s", errorPrefix, err.Error()),
|
||||
}
|
||||
return localVarReturnValue, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
@ -27,84 +27,84 @@ var (
|
||||
type LegacyAuthorizationsApi interface {
|
||||
|
||||
/*
|
||||
* DeleteAuthorizationsID Delete an authorization
|
||||
* DeleteLegacyAuthorizationsID Delete a legacy authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to delete.
|
||||
* @return ApiDeleteAuthorizationsIDRequest
|
||||
* @param authID The ID of the legacy authorization to delete.
|
||||
* @return ApiDeleteLegacyAuthorizationsIDRequest
|
||||
*/
|
||||
DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest
|
||||
DeleteLegacyAuthorizationsID(ctx _context.Context, authID string) ApiDeleteLegacyAuthorizationsIDRequest
|
||||
|
||||
/*
|
||||
* DeleteAuthorizationsIDExecute executes the request
|
||||
* DeleteLegacyAuthorizationsIDExecute executes the request
|
||||
*/
|
||||
DeleteAuthorizationsIDExecute(r ApiDeleteAuthorizationsIDRequest) error
|
||||
DeleteLegacyAuthorizationsIDExecute(r ApiDeleteLegacyAuthorizationsIDRequest) error
|
||||
|
||||
/*
|
||||
* GetAuthorizations List all authorizations
|
||||
* GetLegacyAuthorizations List all legacy authorizations
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiGetAuthorizationsRequest
|
||||
* @return ApiGetLegacyAuthorizationsRequest
|
||||
*/
|
||||
GetAuthorizations(ctx _context.Context) ApiGetAuthorizationsRequest
|
||||
GetLegacyAuthorizations(ctx _context.Context) ApiGetLegacyAuthorizationsRequest
|
||||
|
||||
/*
|
||||
* GetAuthorizationsExecute executes the request
|
||||
* GetLegacyAuthorizationsExecute executes the request
|
||||
* @return Authorizations
|
||||
*/
|
||||
GetAuthorizationsExecute(r ApiGetAuthorizationsRequest) (Authorizations, error)
|
||||
GetLegacyAuthorizationsExecute(r ApiGetLegacyAuthorizationsRequest) (Authorizations, error)
|
||||
|
||||
/*
|
||||
* GetAuthorizationsID Retrieve an authorization
|
||||
* GetLegacyAuthorizationsID Retrieve a legacy authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to get.
|
||||
* @return ApiGetAuthorizationsIDRequest
|
||||
* @param authID The ID of the legacy authorization to get.
|
||||
* @return ApiGetLegacyAuthorizationsIDRequest
|
||||
*/
|
||||
GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest
|
||||
GetLegacyAuthorizationsID(ctx _context.Context, authID string) ApiGetLegacyAuthorizationsIDRequest
|
||||
|
||||
/*
|
||||
* GetAuthorizationsIDExecute executes the request
|
||||
* GetLegacyAuthorizationsIDExecute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
GetAuthorizationsIDExecute(r ApiGetAuthorizationsIDRequest) (Authorization, error)
|
||||
GetLegacyAuthorizationsIDExecute(r ApiGetLegacyAuthorizationsIDRequest) (Authorization, error)
|
||||
|
||||
/*
|
||||
* PatchAuthorizationsID Update an authorization to be active or inactive
|
||||
* PatchLegacyAuthorizationsID Update a legacy authorization to be active or inactive
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to update.
|
||||
* @return ApiPatchAuthorizationsIDRequest
|
||||
* @param authID The ID of the legacy authorization to update.
|
||||
* @return ApiPatchLegacyAuthorizationsIDRequest
|
||||
*/
|
||||
PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest
|
||||
PatchLegacyAuthorizationsID(ctx _context.Context, authID string) ApiPatchLegacyAuthorizationsIDRequest
|
||||
|
||||
/*
|
||||
* PatchAuthorizationsIDExecute executes the request
|
||||
* PatchLegacyAuthorizationsIDExecute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
PatchAuthorizationsIDExecute(r ApiPatchAuthorizationsIDRequest) (Authorization, error)
|
||||
PatchLegacyAuthorizationsIDExecute(r ApiPatchLegacyAuthorizationsIDRequest) (Authorization, error)
|
||||
|
||||
/*
|
||||
* PostAuthorizations Create an authorization
|
||||
* PostLegacyAuthorizations Create a legacy authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiPostAuthorizationsRequest
|
||||
* @return ApiPostLegacyAuthorizationsRequest
|
||||
*/
|
||||
PostAuthorizations(ctx _context.Context) ApiPostAuthorizationsRequest
|
||||
PostLegacyAuthorizations(ctx _context.Context) ApiPostLegacyAuthorizationsRequest
|
||||
|
||||
/*
|
||||
* PostAuthorizationsExecute executes the request
|
||||
* PostLegacyAuthorizationsExecute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
PostAuthorizationsExecute(r ApiPostAuthorizationsRequest) (Authorization, error)
|
||||
PostLegacyAuthorizationsExecute(r ApiPostLegacyAuthorizationsRequest) (Authorization, error)
|
||||
|
||||
/*
|
||||
* PostAuthorizationsIDPassword Set an authorization password
|
||||
* PostLegacyAuthorizationsIDPassword Set a legacy authorization password
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to update.
|
||||
* @return ApiPostAuthorizationsIDPasswordRequest
|
||||
* @param authID The ID of the legacy authorization to update.
|
||||
* @return ApiPostLegacyAuthorizationsIDPasswordRequest
|
||||
*/
|
||||
PostAuthorizationsIDPassword(ctx _context.Context, authID string) ApiPostAuthorizationsIDPasswordRequest
|
||||
PostLegacyAuthorizationsIDPassword(ctx _context.Context, authID string) ApiPostLegacyAuthorizationsIDPasswordRequest
|
||||
|
||||
/*
|
||||
* PostAuthorizationsIDPasswordExecute executes the request
|
||||
* PostLegacyAuthorizationsIDPasswordExecute executes the request
|
||||
*/
|
||||
PostAuthorizationsIDPasswordExecute(r ApiPostAuthorizationsIDPasswordRequest) error
|
||||
PostLegacyAuthorizationsIDPasswordExecute(r ApiPostLegacyAuthorizationsIDPasswordRequest) error
|
||||
|
||||
// Sets additional descriptive text in the error message if any request in
|
||||
// this API fails, indicating that it is intended to be used only on OSS
|
||||
@ -130,41 +130,41 @@ func (a *LegacyAuthorizationsApiService) OnlyCloud() LegacyAuthorizationsApi {
|
||||
return a
|
||||
}
|
||||
|
||||
type ApiDeleteAuthorizationsIDRequest struct {
|
||||
type ApiDeleteLegacyAuthorizationsIDRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService LegacyAuthorizationsApi
|
||||
authID string
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiDeleteAuthorizationsIDRequest) AuthID(authID string) ApiDeleteAuthorizationsIDRequest {
|
||||
func (r ApiDeleteLegacyAuthorizationsIDRequest) AuthID(authID string) ApiDeleteLegacyAuthorizationsIDRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiDeleteAuthorizationsIDRequest) GetAuthID() string {
|
||||
func (r ApiDeleteLegacyAuthorizationsIDRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiDeleteAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiDeleteAuthorizationsIDRequest {
|
||||
func (r ApiDeleteLegacyAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiDeleteLegacyAuthorizationsIDRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiDeleteAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
func (r ApiDeleteLegacyAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiDeleteAuthorizationsIDRequest) Execute() error {
|
||||
return r.ApiService.DeleteAuthorizationsIDExecute(r)
|
||||
func (r ApiDeleteLegacyAuthorizationsIDRequest) Execute() error {
|
||||
return r.ApiService.DeleteLegacyAuthorizationsIDExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* DeleteAuthorizationsID Delete an authorization
|
||||
* DeleteLegacyAuthorizationsID Delete a legacy authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to delete.
|
||||
* @return ApiDeleteAuthorizationsIDRequest
|
||||
* @param authID The ID of the legacy authorization to delete.
|
||||
* @return ApiDeleteLegacyAuthorizationsIDRequest
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) DeleteAuthorizationsID(ctx _context.Context, authID string) ApiDeleteAuthorizationsIDRequest {
|
||||
return ApiDeleteAuthorizationsIDRequest{
|
||||
func (a *LegacyAuthorizationsApiService) DeleteLegacyAuthorizationsID(ctx _context.Context, authID string) ApiDeleteLegacyAuthorizationsIDRequest {
|
||||
return ApiDeleteLegacyAuthorizationsIDRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
@ -174,7 +174,7 @@ func (a *LegacyAuthorizationsApiService) DeleteAuthorizationsID(ctx _context.Con
|
||||
/*
|
||||
* Execute executes the request
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) DeleteAuthorizationsIDExecute(r ApiDeleteAuthorizationsIDRequest) error {
|
||||
func (a *LegacyAuthorizationsApiService) DeleteLegacyAuthorizationsIDExecute(r ApiDeleteLegacyAuthorizationsIDRequest) error {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
@ -183,7 +183,7 @@ func (a *LegacyAuthorizationsApiService) DeleteAuthorizationsIDExecute(r ApiDele
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.DeleteAuthorizationsID")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.DeleteLegacyAuthorizationsID")
|
||||
if err != nil {
|
||||
return GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
@ -261,7 +261,7 @@ func (a *LegacyAuthorizationsApiService) DeleteAuthorizationsIDExecute(r ApiDele
|
||||
return nil
|
||||
}
|
||||
|
||||
type ApiGetAuthorizationsRequest struct {
|
||||
type ApiGetLegacyAuthorizationsRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService LegacyAuthorizationsApi
|
||||
zapTraceSpan *string
|
||||
@ -273,73 +273,73 @@ type ApiGetAuthorizationsRequest struct {
|
||||
authID *string
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetZapTraceSpan() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) UserID(userID string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) UserID(userID string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.userID = &userID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetUserID() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetUserID() *string {
|
||||
return r.userID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) User(user string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) User(user string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.user = &user
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetUser() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetUser() *string {
|
||||
return r.user
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) OrgID(orgID string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) OrgID(orgID string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.orgID = &orgID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetOrgID() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetOrgID() *string {
|
||||
return r.orgID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) Org(org string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) Org(org string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.org = &org
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetOrg() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetOrg() *string {
|
||||
return r.org
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) Token(token string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) Token(token string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.token = &token
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetToken() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetToken() *string {
|
||||
return r.token
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) AuthID(authID string) ApiGetAuthorizationsRequest {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) AuthID(authID string) ApiGetLegacyAuthorizationsRequest {
|
||||
r.authID = &authID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsRequest) GetAuthID() *string {
|
||||
func (r ApiGetLegacyAuthorizationsRequest) GetAuthID() *string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsRequest) Execute() (Authorizations, error) {
|
||||
return r.ApiService.GetAuthorizationsExecute(r)
|
||||
func (r ApiGetLegacyAuthorizationsRequest) Execute() (Authorizations, error) {
|
||||
return r.ApiService.GetLegacyAuthorizationsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* GetAuthorizations List all authorizations
|
||||
* GetLegacyAuthorizations List all legacy authorizations
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiGetAuthorizationsRequest
|
||||
* @return ApiGetLegacyAuthorizationsRequest
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) GetAuthorizations(ctx _context.Context) ApiGetAuthorizationsRequest {
|
||||
return ApiGetAuthorizationsRequest{
|
||||
func (a *LegacyAuthorizationsApiService) GetLegacyAuthorizations(ctx _context.Context) ApiGetLegacyAuthorizationsRequest {
|
||||
return ApiGetLegacyAuthorizationsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
@ -349,7 +349,7 @@ func (a *LegacyAuthorizationsApiService) GetAuthorizations(ctx _context.Context)
|
||||
* Execute executes the request
|
||||
* @return Authorizations
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) GetAuthorizationsExecute(r ApiGetAuthorizationsRequest) (Authorizations, error) {
|
||||
func (a *LegacyAuthorizationsApiService) GetLegacyAuthorizationsExecute(r ApiGetLegacyAuthorizationsRequest) (Authorizations, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
@ -359,7 +359,7 @@ func (a *LegacyAuthorizationsApiService) GetAuthorizationsExecute(r ApiGetAuthor
|
||||
localVarReturnValue Authorizations
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.GetAuthorizations")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.GetLegacyAuthorizations")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
@ -473,41 +473,41 @@ func (a *LegacyAuthorizationsApiService) GetAuthorizationsExecute(r ApiGetAuthor
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiGetAuthorizationsIDRequest struct {
|
||||
type ApiGetLegacyAuthorizationsIDRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService LegacyAuthorizationsApi
|
||||
authID string
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsIDRequest) AuthID(authID string) ApiGetAuthorizationsIDRequest {
|
||||
func (r ApiGetLegacyAuthorizationsIDRequest) AuthID(authID string) ApiGetLegacyAuthorizationsIDRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsIDRequest) GetAuthID() string {
|
||||
func (r ApiGetLegacyAuthorizationsIDRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiGetAuthorizationsIDRequest {
|
||||
func (r ApiGetLegacyAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiGetLegacyAuthorizationsIDRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiGetAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
func (r ApiGetLegacyAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiGetAuthorizationsIDRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.GetAuthorizationsIDExecute(r)
|
||||
func (r ApiGetLegacyAuthorizationsIDRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.GetLegacyAuthorizationsIDExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* GetAuthorizationsID Retrieve an authorization
|
||||
* GetLegacyAuthorizationsID Retrieve a legacy authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to get.
|
||||
* @return ApiGetAuthorizationsIDRequest
|
||||
* @param authID The ID of the legacy authorization to get.
|
||||
* @return ApiGetLegacyAuthorizationsIDRequest
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) GetAuthorizationsID(ctx _context.Context, authID string) ApiGetAuthorizationsIDRequest {
|
||||
return ApiGetAuthorizationsIDRequest{
|
||||
func (a *LegacyAuthorizationsApiService) GetLegacyAuthorizationsID(ctx _context.Context, authID string) ApiGetLegacyAuthorizationsIDRequest {
|
||||
return ApiGetLegacyAuthorizationsIDRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
@ -518,7 +518,7 @@ func (a *LegacyAuthorizationsApiService) GetAuthorizationsID(ctx _context.Contex
|
||||
* Execute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) GetAuthorizationsIDExecute(r ApiGetAuthorizationsIDRequest) (Authorization, error) {
|
||||
func (a *LegacyAuthorizationsApiService) GetLegacyAuthorizationsIDExecute(r ApiGetLegacyAuthorizationsIDRequest) (Authorization, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodGet
|
||||
localVarPostBody interface{}
|
||||
@ -528,7 +528,7 @@ func (a *LegacyAuthorizationsApiService) GetAuthorizationsIDExecute(r ApiGetAuth
|
||||
localVarReturnValue Authorization
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.GetAuthorizationsID")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.GetLegacyAuthorizationsID")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
@ -625,7 +625,7 @@ func (a *LegacyAuthorizationsApiService) GetAuthorizationsIDExecute(r ApiGetAuth
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiPatchAuthorizationsIDRequest struct {
|
||||
type ApiPatchLegacyAuthorizationsIDRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService LegacyAuthorizationsApi
|
||||
authID string
|
||||
@ -633,42 +633,42 @@ type ApiPatchAuthorizationsIDRequest struct {
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) AuthID(authID string) ApiPatchAuthorizationsIDRequest {
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) AuthID(authID string) ApiPatchLegacyAuthorizationsIDRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiPatchAuthorizationsIDRequest) GetAuthID() string {
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) AuthorizationUpdateRequest(authorizationUpdateRequest AuthorizationUpdateRequest) ApiPatchAuthorizationsIDRequest {
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) AuthorizationUpdateRequest(authorizationUpdateRequest AuthorizationUpdateRequest) ApiPatchLegacyAuthorizationsIDRequest {
|
||||
r.authorizationUpdateRequest = &authorizationUpdateRequest
|
||||
return r
|
||||
}
|
||||
func (r ApiPatchAuthorizationsIDRequest) GetAuthorizationUpdateRequest() *AuthorizationUpdateRequest {
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) GetAuthorizationUpdateRequest() *AuthorizationUpdateRequest {
|
||||
return r.authorizationUpdateRequest
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiPatchAuthorizationsIDRequest {
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) ZapTraceSpan(zapTraceSpan string) ApiPatchLegacyAuthorizationsIDRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiPatchAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiPatchAuthorizationsIDRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.PatchAuthorizationsIDExecute(r)
|
||||
func (r ApiPatchLegacyAuthorizationsIDRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.PatchLegacyAuthorizationsIDExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* PatchAuthorizationsID Update an authorization to be active or inactive
|
||||
* PatchLegacyAuthorizationsID Update a legacy authorization to be active or inactive
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to update.
|
||||
* @return ApiPatchAuthorizationsIDRequest
|
||||
* @param authID The ID of the legacy authorization to update.
|
||||
* @return ApiPatchLegacyAuthorizationsIDRequest
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) PatchAuthorizationsID(ctx _context.Context, authID string) ApiPatchAuthorizationsIDRequest {
|
||||
return ApiPatchAuthorizationsIDRequest{
|
||||
func (a *LegacyAuthorizationsApiService) PatchLegacyAuthorizationsID(ctx _context.Context, authID string) ApiPatchLegacyAuthorizationsIDRequest {
|
||||
return ApiPatchLegacyAuthorizationsIDRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
@ -679,7 +679,7 @@ func (a *LegacyAuthorizationsApiService) PatchAuthorizationsID(ctx _context.Cont
|
||||
* Execute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) PatchAuthorizationsIDExecute(r ApiPatchAuthorizationsIDRequest) (Authorization, error) {
|
||||
func (a *LegacyAuthorizationsApiService) PatchLegacyAuthorizationsIDExecute(r ApiPatchLegacyAuthorizationsIDRequest) (Authorization, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
@ -689,7 +689,7 @@ func (a *LegacyAuthorizationsApiService) PatchAuthorizationsIDExecute(r ApiPatch
|
||||
localVarReturnValue Authorization
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.PatchAuthorizationsID")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.PatchLegacyAuthorizationsID")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
@ -791,40 +791,40 @@ func (a *LegacyAuthorizationsApiService) PatchAuthorizationsIDExecute(r ApiPatch
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiPostAuthorizationsRequest struct {
|
||||
type ApiPostLegacyAuthorizationsRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService LegacyAuthorizationsApi
|
||||
legacyAuthorizationPostRequest *LegacyAuthorizationPostRequest
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsRequest) LegacyAuthorizationPostRequest(legacyAuthorizationPostRequest LegacyAuthorizationPostRequest) ApiPostAuthorizationsRequest {
|
||||
func (r ApiPostLegacyAuthorizationsRequest) LegacyAuthorizationPostRequest(legacyAuthorizationPostRequest LegacyAuthorizationPostRequest) ApiPostLegacyAuthorizationsRequest {
|
||||
r.legacyAuthorizationPostRequest = &legacyAuthorizationPostRequest
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsRequest) GetLegacyAuthorizationPostRequest() *LegacyAuthorizationPostRequest {
|
||||
func (r ApiPostLegacyAuthorizationsRequest) GetLegacyAuthorizationPostRequest() *LegacyAuthorizationPostRequest {
|
||||
return r.legacyAuthorizationPostRequest
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiPostAuthorizationsRequest {
|
||||
func (r ApiPostLegacyAuthorizationsRequest) ZapTraceSpan(zapTraceSpan string) ApiPostLegacyAuthorizationsRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsRequest) GetZapTraceSpan() *string {
|
||||
func (r ApiPostLegacyAuthorizationsRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.PostAuthorizationsExecute(r)
|
||||
func (r ApiPostLegacyAuthorizationsRequest) Execute() (Authorization, error) {
|
||||
return r.ApiService.PostLegacyAuthorizationsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* PostAuthorizations Create an authorization
|
||||
* PostLegacyAuthorizations Create a legacy authorization
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @return ApiPostAuthorizationsRequest
|
||||
* @return ApiPostLegacyAuthorizationsRequest
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) PostAuthorizations(ctx _context.Context) ApiPostAuthorizationsRequest {
|
||||
return ApiPostAuthorizationsRequest{
|
||||
func (a *LegacyAuthorizationsApiService) PostLegacyAuthorizations(ctx _context.Context) ApiPostLegacyAuthorizationsRequest {
|
||||
return ApiPostLegacyAuthorizationsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
@ -834,7 +834,7 @@ func (a *LegacyAuthorizationsApiService) PostAuthorizations(ctx _context.Context
|
||||
* Execute executes the request
|
||||
* @return Authorization
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) PostAuthorizationsExecute(r ApiPostAuthorizationsRequest) (Authorization, error) {
|
||||
func (a *LegacyAuthorizationsApiService) PostLegacyAuthorizationsExecute(r ApiPostLegacyAuthorizationsRequest) (Authorization, error) {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
@ -844,7 +844,7 @@ func (a *LegacyAuthorizationsApiService) PostAuthorizationsExecute(r ApiPostAuth
|
||||
localVarReturnValue Authorization
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.PostAuthorizations")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.PostLegacyAuthorizations")
|
||||
if err != nil {
|
||||
return localVarReturnValue, GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
@ -956,7 +956,7 @@ func (a *LegacyAuthorizationsApiService) PostAuthorizationsExecute(r ApiPostAuth
|
||||
return localVarReturnValue, nil
|
||||
}
|
||||
|
||||
type ApiPostAuthorizationsIDPasswordRequest struct {
|
||||
type ApiPostLegacyAuthorizationsIDPasswordRequest struct {
|
||||
ctx _context.Context
|
||||
ApiService LegacyAuthorizationsApi
|
||||
authID string
|
||||
@ -964,42 +964,42 @@ type ApiPostAuthorizationsIDPasswordRequest struct {
|
||||
zapTraceSpan *string
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) AuthID(authID string) ApiPostAuthorizationsIDPasswordRequest {
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) AuthID(authID string) ApiPostLegacyAuthorizationsIDPasswordRequest {
|
||||
r.authID = authID
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) GetAuthID() string {
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) GetAuthID() string {
|
||||
return r.authID
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) PasswordResetBody(passwordResetBody PasswordResetBody) ApiPostAuthorizationsIDPasswordRequest {
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) PasswordResetBody(passwordResetBody PasswordResetBody) ApiPostLegacyAuthorizationsIDPasswordRequest {
|
||||
r.passwordResetBody = &passwordResetBody
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) GetPasswordResetBody() *PasswordResetBody {
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) GetPasswordResetBody() *PasswordResetBody {
|
||||
return r.passwordResetBody
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) ZapTraceSpan(zapTraceSpan string) ApiPostAuthorizationsIDPasswordRequest {
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) ZapTraceSpan(zapTraceSpan string) ApiPostLegacyAuthorizationsIDPasswordRequest {
|
||||
r.zapTraceSpan = &zapTraceSpan
|
||||
return r
|
||||
}
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) GetZapTraceSpan() *string {
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) GetZapTraceSpan() *string {
|
||||
return r.zapTraceSpan
|
||||
}
|
||||
|
||||
func (r ApiPostAuthorizationsIDPasswordRequest) Execute() error {
|
||||
return r.ApiService.PostAuthorizationsIDPasswordExecute(r)
|
||||
func (r ApiPostLegacyAuthorizationsIDPasswordRequest) Execute() error {
|
||||
return r.ApiService.PostLegacyAuthorizationsIDPasswordExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
* PostAuthorizationsIDPassword Set an authorization password
|
||||
* PostLegacyAuthorizationsIDPassword Set a legacy authorization password
|
||||
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param authID The ID of the authorization to update.
|
||||
* @return ApiPostAuthorizationsIDPasswordRequest
|
||||
* @param authID The ID of the legacy authorization to update.
|
||||
* @return ApiPostLegacyAuthorizationsIDPasswordRequest
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) PostAuthorizationsIDPassword(ctx _context.Context, authID string) ApiPostAuthorizationsIDPasswordRequest {
|
||||
return ApiPostAuthorizationsIDPasswordRequest{
|
||||
func (a *LegacyAuthorizationsApiService) PostLegacyAuthorizationsIDPassword(ctx _context.Context, authID string) ApiPostLegacyAuthorizationsIDPasswordRequest {
|
||||
return ApiPostLegacyAuthorizationsIDPasswordRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
authID: authID,
|
||||
@ -1009,7 +1009,7 @@ func (a *LegacyAuthorizationsApiService) PostAuthorizationsIDPassword(ctx _conte
|
||||
/*
|
||||
* Execute executes the request
|
||||
*/
|
||||
func (a *LegacyAuthorizationsApiService) PostAuthorizationsIDPasswordExecute(r ApiPostAuthorizationsIDPasswordRequest) error {
|
||||
func (a *LegacyAuthorizationsApiService) PostLegacyAuthorizationsIDPasswordExecute(r ApiPostLegacyAuthorizationsIDPasswordRequest) error {
|
||||
var (
|
||||
localVarHTTPMethod = _nethttp.MethodPost
|
||||
localVarPostBody interface{}
|
||||
@ -1018,7 +1018,7 @@ func (a *LegacyAuthorizationsApiService) PostAuthorizationsIDPasswordExecute(r A
|
||||
localVarFileBytes []byte
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.PostAuthorizationsIDPassword")
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LegacyAuthorizationsApiService.PostLegacyAuthorizationsIDPassword")
|
||||
if err != nil {
|
||||
return GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
@ -47,6 +47,8 @@ type APIClient struct {
|
||||
|
||||
// API Services
|
||||
|
||||
AuthorizationsApi AuthorizationsApi
|
||||
|
||||
BackupApi BackupApi
|
||||
|
||||
BucketSchemasApi BucketSchemasApi
|
||||
@ -102,6 +104,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
|
||||
c.common.client = c
|
||||
|
||||
// API Services
|
||||
c.AuthorizationsApi = (*AuthorizationsApiService)(&c.common)
|
||||
c.BackupApi = (*BackupApiService)(&c.common)
|
||||
c.BucketSchemasApi = (*BucketSchemasApiService)(&c.common)
|
||||
c.BucketsApi = (*BucketsApiService)(&c.common)
|
||||
|
||||
@ -113,37 +113,37 @@ func NewConfiguration() *Configuration {
|
||||
Description: "No description provided",
|
||||
},
|
||||
},
|
||||
"LegacyAuthorizationsApiService.DeleteAuthorizationsID": {
|
||||
"LegacyAuthorizationsApiService.DeleteLegacyAuthorizationsID": {
|
||||
{
|
||||
URL: "/private",
|
||||
Description: "No description provided",
|
||||
},
|
||||
},
|
||||
"LegacyAuthorizationsApiService.GetAuthorizations": {
|
||||
"LegacyAuthorizationsApiService.GetLegacyAuthorizations": {
|
||||
{
|
||||
URL: "/private",
|
||||
Description: "No description provided",
|
||||
},
|
||||
},
|
||||
"LegacyAuthorizationsApiService.GetAuthorizationsID": {
|
||||
"LegacyAuthorizationsApiService.GetLegacyAuthorizationsID": {
|
||||
{
|
||||
URL: "/private",
|
||||
Description: "No description provided",
|
||||
},
|
||||
},
|
||||
"LegacyAuthorizationsApiService.PatchAuthorizationsID": {
|
||||
"LegacyAuthorizationsApiService.PatchLegacyAuthorizationsID": {
|
||||
{
|
||||
URL: "/private",
|
||||
Description: "No description provided",
|
||||
},
|
||||
},
|
||||
"LegacyAuthorizationsApiService.PostAuthorizations": {
|
||||
"LegacyAuthorizationsApiService.PostLegacyAuthorizations": {
|
||||
{
|
||||
URL: "/private",
|
||||
Description: "No description provided",
|
||||
},
|
||||
},
|
||||
"LegacyAuthorizationsApiService.PostAuthorizationsIDPassword": {
|
||||
"LegacyAuthorizationsApiService.PostLegacyAuthorizationsIDPassword": {
|
||||
{
|
||||
URL: "/private",
|
||||
Description: "No description provided",
|
||||
|
||||
@ -95,6 +95,10 @@ paths:
|
||||
servers:
|
||||
- url: "/private"
|
||||
$ref: "./openapi/src/oss/paths/legacy_authorizations_authID_password.yml"
|
||||
/authorizations:
|
||||
$ref: "./openapi/src/common/paths/authorizations.yml"
|
||||
/authorizations/{authID}:
|
||||
$ref: "./openapi/src/common/paths/authorizations_authID.yml"
|
||||
components:
|
||||
parameters:
|
||||
TraceSpan:
|
||||
@ -385,3 +389,5 @@ components:
|
||||
$ref: "./openapi/src/common/schemas/Authorizations.yml"
|
||||
LegacyAuthorizationPostRequest:
|
||||
$ref: "./openapi/src/oss/schemas/LegacyAuthorizationPostRequest.yml"
|
||||
AuthorizationPostRequest:
|
||||
$ref: "./openapi/src/common/schemas/AuthorizationPostRequest.yml"
|
||||
|
||||
Submodule api/contract/openapi updated: 6b464c86dd...99b90ac05a
252
api/model_authorization_post_request.gen.go
Normal file
252
api/model_authorization_post_request.gen.go
Normal file
@ -0,0 +1,252 @@
|
||||
/*
|
||||
* Subset of Influx API covered by Influx CLI
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 2.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// AuthorizationPostRequest struct for AuthorizationPostRequest
|
||||
type AuthorizationPostRequest struct {
|
||||
// If inactive the token is inactive and requests using the token will be rejected.
|
||||
Status *string `json:"status,omitempty" yaml:"status,omitempty"`
|
||||
// A description of the token.
|
||||
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
// ID of org that authorization is scoped to.
|
||||
OrgID string `json:"orgID" yaml:"orgID"`
|
||||
// ID of user that authorization is scoped to.
|
||||
UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"`
|
||||
// List of permissions for an auth. An auth must have at least one Permission.
|
||||
Permissions []Permission `json:"permissions" yaml:"permissions"`
|
||||
}
|
||||
|
||||
// NewAuthorizationPostRequest instantiates a new AuthorizationPostRequest object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewAuthorizationPostRequest(orgID string, permissions []Permission) *AuthorizationPostRequest {
|
||||
this := AuthorizationPostRequest{}
|
||||
var status string = "active"
|
||||
this.Status = &status
|
||||
this.OrgID = orgID
|
||||
this.Permissions = permissions
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewAuthorizationPostRequestWithDefaults instantiates a new AuthorizationPostRequest object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewAuthorizationPostRequestWithDefaults() *AuthorizationPostRequest {
|
||||
this := AuthorizationPostRequest{}
|
||||
var status string = "active"
|
||||
this.Status = &status
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetStatus returns the Status field value if set, zero value otherwise.
|
||||
func (o *AuthorizationPostRequest) GetStatus() string {
|
||||
if o == nil || o.Status == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Status
|
||||
}
|
||||
|
||||
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequest) GetStatusOk() (*string, bool) {
|
||||
if o == nil || o.Status == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Status, true
|
||||
}
|
||||
|
||||
// HasStatus returns a boolean if a field has been set.
|
||||
func (o *AuthorizationPostRequest) HasStatus() bool {
|
||||
if o != nil && o.Status != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
||||
func (o *AuthorizationPostRequest) SetStatus(v string) {
|
||||
o.Status = &v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *AuthorizationPostRequest) GetDescription() string {
|
||||
if o == nil || o.Description == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequest) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil || o.Description == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description, true
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *AuthorizationPostRequest) HasDescription() bool {
|
||||
if o != nil && o.Description != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *AuthorizationPostRequest) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetOrgID returns the OrgID field value
|
||||
func (o *AuthorizationPostRequest) GetOrgID() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.OrgID
|
||||
}
|
||||
|
||||
// GetOrgIDOk returns a tuple with the OrgID field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequest) GetOrgIDOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.OrgID, true
|
||||
}
|
||||
|
||||
// SetOrgID sets field value
|
||||
func (o *AuthorizationPostRequest) SetOrgID(v string) {
|
||||
o.OrgID = v
|
||||
}
|
||||
|
||||
// GetUserID returns the UserID field value if set, zero value otherwise.
|
||||
func (o *AuthorizationPostRequest) GetUserID() string {
|
||||
if o == nil || o.UserID == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.UserID
|
||||
}
|
||||
|
||||
// GetUserIDOk returns a tuple with the UserID field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequest) GetUserIDOk() (*string, bool) {
|
||||
if o == nil || o.UserID == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.UserID, true
|
||||
}
|
||||
|
||||
// HasUserID returns a boolean if a field has been set.
|
||||
func (o *AuthorizationPostRequest) HasUserID() bool {
|
||||
if o != nil && o.UserID != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUserID gets a reference to the given string and assigns it to the UserID field.
|
||||
func (o *AuthorizationPostRequest) SetUserID(v string) {
|
||||
o.UserID = &v
|
||||
}
|
||||
|
||||
// GetPermissions returns the Permissions field value
|
||||
func (o *AuthorizationPostRequest) GetPermissions() []Permission {
|
||||
if o == nil {
|
||||
var ret []Permission
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Permissions
|
||||
}
|
||||
|
||||
// GetPermissionsOk returns a tuple with the Permissions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequest) GetPermissionsOk() (*[]Permission, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Permissions, true
|
||||
}
|
||||
|
||||
// SetPermissions sets field value
|
||||
func (o *AuthorizationPostRequest) SetPermissions(v []Permission) {
|
||||
o.Permissions = v
|
||||
}
|
||||
|
||||
func (o AuthorizationPostRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if o.Status != nil {
|
||||
toSerialize["status"] = o.Status
|
||||
}
|
||||
if o.Description != nil {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if true {
|
||||
toSerialize["orgID"] = o.OrgID
|
||||
}
|
||||
if o.UserID != nil {
|
||||
toSerialize["userID"] = o.UserID
|
||||
}
|
||||
if true {
|
||||
toSerialize["permissions"] = o.Permissions
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
type NullableAuthorizationPostRequest struct {
|
||||
value *AuthorizationPostRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAuthorizationPostRequest) Get() *AuthorizationPostRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAuthorizationPostRequest) Set(val *AuthorizationPostRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAuthorizationPostRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAuthorizationPostRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAuthorizationPostRequest(val *AuthorizationPostRequest) *NullableAuthorizationPostRequest {
|
||||
return &NullableAuthorizationPostRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAuthorizationPostRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAuthorizationPostRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
188
api/model_authorization_post_request_all_of.gen.go
Normal file
188
api/model_authorization_post_request_all_of.gen.go
Normal file
@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Subset of Influx API covered by Influx CLI
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* API version: 2.0.0
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// AuthorizationPostRequestAllOf struct for AuthorizationPostRequestAllOf
|
||||
type AuthorizationPostRequestAllOf struct {
|
||||
// ID of org that authorization is scoped to.
|
||||
OrgID *string `json:"orgID,omitempty" yaml:"orgID,omitempty"`
|
||||
// ID of user that authorization is scoped to.
|
||||
UserID *string `json:"userID,omitempty" yaml:"userID,omitempty"`
|
||||
// List of permissions for an auth. An auth must have at least one Permission.
|
||||
Permissions *[]Permission `json:"permissions,omitempty" yaml:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// NewAuthorizationPostRequestAllOf instantiates a new AuthorizationPostRequestAllOf object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewAuthorizationPostRequestAllOf() *AuthorizationPostRequestAllOf {
|
||||
this := AuthorizationPostRequestAllOf{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewAuthorizationPostRequestAllOfWithDefaults instantiates a new AuthorizationPostRequestAllOf object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewAuthorizationPostRequestAllOfWithDefaults() *AuthorizationPostRequestAllOf {
|
||||
this := AuthorizationPostRequestAllOf{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOrgID returns the OrgID field value if set, zero value otherwise.
|
||||
func (o *AuthorizationPostRequestAllOf) GetOrgID() string {
|
||||
if o == nil || o.OrgID == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OrgID
|
||||
}
|
||||
|
||||
// GetOrgIDOk returns a tuple with the OrgID field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequestAllOf) GetOrgIDOk() (*string, bool) {
|
||||
if o == nil || o.OrgID == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.OrgID, true
|
||||
}
|
||||
|
||||
// HasOrgID returns a boolean if a field has been set.
|
||||
func (o *AuthorizationPostRequestAllOf) HasOrgID() bool {
|
||||
if o != nil && o.OrgID != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOrgID gets a reference to the given string and assigns it to the OrgID field.
|
||||
func (o *AuthorizationPostRequestAllOf) SetOrgID(v string) {
|
||||
o.OrgID = &v
|
||||
}
|
||||
|
||||
// GetUserID returns the UserID field value if set, zero value otherwise.
|
||||
func (o *AuthorizationPostRequestAllOf) GetUserID() string {
|
||||
if o == nil || o.UserID == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.UserID
|
||||
}
|
||||
|
||||
// GetUserIDOk returns a tuple with the UserID field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequestAllOf) GetUserIDOk() (*string, bool) {
|
||||
if o == nil || o.UserID == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.UserID, true
|
||||
}
|
||||
|
||||
// HasUserID returns a boolean if a field has been set.
|
||||
func (o *AuthorizationPostRequestAllOf) HasUserID() bool {
|
||||
if o != nil && o.UserID != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUserID gets a reference to the given string and assigns it to the UserID field.
|
||||
func (o *AuthorizationPostRequestAllOf) SetUserID(v string) {
|
||||
o.UserID = &v
|
||||
}
|
||||
|
||||
// GetPermissions returns the Permissions field value if set, zero value otherwise.
|
||||
func (o *AuthorizationPostRequestAllOf) GetPermissions() []Permission {
|
||||
if o == nil || o.Permissions == nil {
|
||||
var ret []Permission
|
||||
return ret
|
||||
}
|
||||
return *o.Permissions
|
||||
}
|
||||
|
||||
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AuthorizationPostRequestAllOf) GetPermissionsOk() (*[]Permission, bool) {
|
||||
if o == nil || o.Permissions == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Permissions, true
|
||||
}
|
||||
|
||||
// HasPermissions returns a boolean if a field has been set.
|
||||
func (o *AuthorizationPostRequestAllOf) HasPermissions() bool {
|
||||
if o != nil && o.Permissions != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPermissions gets a reference to the given []Permission and assigns it to the Permissions field.
|
||||
func (o *AuthorizationPostRequestAllOf) SetPermissions(v []Permission) {
|
||||
o.Permissions = &v
|
||||
}
|
||||
|
||||
func (o AuthorizationPostRequestAllOf) MarshalJSON() ([]byte, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if o.OrgID != nil {
|
||||
toSerialize["orgID"] = o.OrgID
|
||||
}
|
||||
if o.UserID != nil {
|
||||
toSerialize["userID"] = o.UserID
|
||||
}
|
||||
if o.Permissions != nil {
|
||||
toSerialize["permissions"] = o.Permissions
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
type NullableAuthorizationPostRequestAllOf struct {
|
||||
value *AuthorizationPostRequestAllOf
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAuthorizationPostRequestAllOf) Get() *AuthorizationPostRequestAllOf {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAuthorizationPostRequestAllOf) Set(val *AuthorizationPostRequestAllOf) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAuthorizationPostRequestAllOf) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAuthorizationPostRequestAllOf) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAuthorizationPostRequestAllOf(val *AuthorizationPostRequestAllOf) *NullableAuthorizationPostRequestAllOf {
|
||||
return &NullableAuthorizationPostRequestAllOf{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAuthorizationPostRequestAllOf) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAuthorizationPostRequestAllOf) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
15
api/permission_string.go
Normal file
15
api/permission_string.go
Normal file
@ -0,0 +1,15 @@
|
||||
package api
|
||||
|
||||
func (o Permission) String() string {
|
||||
ret := o.GetAction() + ":"
|
||||
r := o.GetResource()
|
||||
|
||||
if r.GetOrgID() != "" {
|
||||
ret += "orgs/" + r.GetOrgID()
|
||||
}
|
||||
ret += "/" + r.GetType()
|
||||
if r.GetId() != "" {
|
||||
ret += "/" + r.GetId()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
Reference in New Issue
Block a user