2020-10-13 11:17:37 -04:00
/ *
* 3 DS OUTSCALE API
*
* Welcome to the 3 DS OUTSCALE ' s API documentation . < br / > < br / > The 3 DS OUTSCALE API enables you to manage your resources in the 3 DS OUTSCALE Cloud . This documentation describes the different actions available along with code examples . < br / > < br / > Note that the 3 DS OUTSCALE Cloud is compatible with Amazon Web Services ( AWS ) APIs , but some resources have different names in AWS than in the 3 DS OUTSCALE API . You can find a list of the differences [ here ] ( https : //wiki.outscale.net/display/EN/3DS+OUTSCALE+APIs+Reference).<br /><br /> You can also manage your resources using the [Cockpit](https://wiki.outscale.net/display/EN/About+Cockpit) web interface.
*
2021-04-20 11:18:45 -04:00
* API version : 1.8
2020-10-13 11:17:37 -04:00
* Contact : support @ outscale . com
* Generated by : OpenAPI Generator ( https : //openapi-generator.tech)
* /
package osc
import (
_context "context"
2021-04-20 11:18:45 -04:00
"github.com/antihax/optional"
2020-10-13 11:17:37 -04:00
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
)
// Linger please
var (
_ _context . Context
)
// AccountApiService AccountApi service
type AccountApiService service
// CheckAuthenticationOpts Optional parameters for the method 'CheckAuthentication'
type CheckAuthenticationOpts struct {
2021-04-20 11:18:45 -04:00
CheckAuthenticationRequest optional . Interface
2020-10-13 11:17:37 -04:00
}
/ *
CheckAuthentication Method for CheckAuthentication
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * CheckAuthenticationOpts - Optional Parameters :
2021-04-20 11:18:45 -04:00
* @ param "CheckAuthenticationRequest" ( optional . Interface of CheckAuthenticationRequest ) -
2020-10-13 11:17:37 -04:00
@ return CheckAuthenticationResponse
* /
func ( a * AccountApiService ) CheckAuthentication ( ctx _context . Context , localVarOptionals * CheckAuthenticationOpts ) ( CheckAuthenticationResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue CheckAuthenticationResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/CheckAuthentication"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . CheckAuthenticationRequest . IsSet ( ) {
localVarOptionalCheckAuthenticationRequest , localVarOptionalCheckAuthenticationRequestok := localVarOptionals . CheckAuthenticationRequest . Value ( ) . ( CheckAuthenticationRequest )
if ! localVarOptionalCheckAuthenticationRequestok {
return localVarReturnValue , nil , reportError ( "checkAuthenticationRequest should be CheckAuthenticationRequest" )
}
localVarPostBody = & localVarOptionalCheckAuthenticationRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v CheckAuthenticationResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}
// CreateAccountOpts Optional parameters for the method 'CreateAccount'
type CreateAccountOpts struct {
2021-04-20 11:18:45 -04:00
CreateAccountRequest optional . Interface
2020-10-13 11:17:37 -04:00
}
/ *
CreateAccount Method for CreateAccount
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * CreateAccountOpts - Optional Parameters :
2021-04-20 11:18:45 -04:00
* @ param "CreateAccountRequest" ( optional . Interface of CreateAccountRequest ) -
2020-10-13 11:17:37 -04:00
@ return CreateAccountResponse
* /
func ( a * AccountApiService ) CreateAccount ( ctx _context . Context , localVarOptionals * CreateAccountOpts ) ( CreateAccountResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue CreateAccountResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/CreateAccount"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . CreateAccountRequest . IsSet ( ) {
localVarOptionalCreateAccountRequest , localVarOptionalCreateAccountRequestok := localVarOptionals . CreateAccountRequest . Value ( ) . ( CreateAccountRequest )
if ! localVarOptionalCreateAccountRequestok {
return localVarReturnValue , nil , reportError ( "createAccountRequest should be CreateAccountRequest" )
}
localVarPostBody = & localVarOptionalCreateAccountRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v CreateAccountResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}
// ReadAccountsOpts Optional parameters for the method 'ReadAccounts'
type ReadAccountsOpts struct {
2021-04-20 11:18:45 -04:00
ReadAccountsRequest optional . Interface
2020-10-13 11:17:37 -04:00
}
/ *
ReadAccounts Method for ReadAccounts
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * ReadAccountsOpts - Optional Parameters :
2021-04-20 11:18:45 -04:00
* @ param "ReadAccountsRequest" ( optional . Interface of ReadAccountsRequest ) -
2020-10-13 11:17:37 -04:00
@ return ReadAccountsResponse
* /
func ( a * AccountApiService ) ReadAccounts ( ctx _context . Context , localVarOptionals * ReadAccountsOpts ) ( ReadAccountsResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue ReadAccountsResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/ReadAccounts"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . ReadAccountsRequest . IsSet ( ) {
localVarOptionalReadAccountsRequest , localVarOptionalReadAccountsRequestok := localVarOptionals . ReadAccountsRequest . Value ( ) . ( ReadAccountsRequest )
if ! localVarOptionalReadAccountsRequestok {
return localVarReturnValue , nil , reportError ( "readAccountsRequest should be ReadAccountsRequest" )
}
localVarPostBody = & localVarOptionalReadAccountsRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v ReadAccountsResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}
2021-04-20 11:18:45 -04:00
// ReadConsumptionAccountOpts Optional parameters for the method 'ReadConsumptionAccount'
type ReadConsumptionAccountOpts struct {
ReadConsumptionAccountRequest optional . Interface
}
/ *
ReadConsumptionAccount Method for ReadConsumptionAccount
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * ReadConsumptionAccountOpts - Optional Parameters :
* @ param "ReadConsumptionAccountRequest" ( optional . Interface of ReadConsumptionAccountRequest ) -
@ return ReadConsumptionAccountResponse
* /
func ( a * AccountApiService ) ReadConsumptionAccount ( ctx _context . Context , localVarOptionals * ReadConsumptionAccountOpts ) ( ReadConsumptionAccountResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue ReadConsumptionAccountResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/ReadConsumptionAccount"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . ReadConsumptionAccountRequest . IsSet ( ) {
localVarOptionalReadConsumptionAccountRequest , localVarOptionalReadConsumptionAccountRequestok := localVarOptionals . ReadConsumptionAccountRequest . Value ( ) . ( ReadConsumptionAccountRequest )
if ! localVarOptionalReadConsumptionAccountRequestok {
return localVarReturnValue , nil , reportError ( "readConsumptionAccountRequest should be ReadConsumptionAccountRequest" )
}
localVarPostBody = & localVarOptionalReadConsumptionAccountRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v ReadConsumptionAccountResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}
2020-10-13 11:17:37 -04:00
// ResetAccountPasswordOpts Optional parameters for the method 'ResetAccountPassword'
type ResetAccountPasswordOpts struct {
2021-04-20 11:18:45 -04:00
ResetAccountPasswordRequest optional . Interface
2020-10-13 11:17:37 -04:00
}
/ *
ResetAccountPassword Method for ResetAccountPassword
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * ResetAccountPasswordOpts - Optional Parameters :
2021-04-20 11:18:45 -04:00
* @ param "ResetAccountPasswordRequest" ( optional . Interface of ResetAccountPasswordRequest ) -
2020-10-13 11:17:37 -04:00
@ return ResetAccountPasswordResponse
* /
func ( a * AccountApiService ) ResetAccountPassword ( ctx _context . Context , localVarOptionals * ResetAccountPasswordOpts ) ( ResetAccountPasswordResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue ResetAccountPasswordResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/ResetAccountPassword"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . ResetAccountPasswordRequest . IsSet ( ) {
localVarOptionalResetAccountPasswordRequest , localVarOptionalResetAccountPasswordRequestok := localVarOptionals . ResetAccountPasswordRequest . Value ( ) . ( ResetAccountPasswordRequest )
if ! localVarOptionalResetAccountPasswordRequestok {
return localVarReturnValue , nil , reportError ( "resetAccountPasswordRequest should be ResetAccountPasswordRequest" )
}
localVarPostBody = & localVarOptionalResetAccountPasswordRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v ResetAccountPasswordResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}
// SendResetPasswordEmailOpts Optional parameters for the method 'SendResetPasswordEmail'
type SendResetPasswordEmailOpts struct {
2021-04-20 11:18:45 -04:00
SendResetPasswordEmailRequest optional . Interface
2020-10-13 11:17:37 -04:00
}
/ *
SendResetPasswordEmail Method for SendResetPasswordEmail
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * SendResetPasswordEmailOpts - Optional Parameters :
2021-04-20 11:18:45 -04:00
* @ param "SendResetPasswordEmailRequest" ( optional . Interface of SendResetPasswordEmailRequest ) -
2020-10-13 11:17:37 -04:00
@ return SendResetPasswordEmailResponse
* /
func ( a * AccountApiService ) SendResetPasswordEmail ( ctx _context . Context , localVarOptionals * SendResetPasswordEmailOpts ) ( SendResetPasswordEmailResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue SendResetPasswordEmailResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/SendResetPasswordEmail"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . SendResetPasswordEmailRequest . IsSet ( ) {
localVarOptionalSendResetPasswordEmailRequest , localVarOptionalSendResetPasswordEmailRequestok := localVarOptionals . SendResetPasswordEmailRequest . Value ( ) . ( SendResetPasswordEmailRequest )
if ! localVarOptionalSendResetPasswordEmailRequestok {
return localVarReturnValue , nil , reportError ( "sendResetPasswordEmailRequest should be SendResetPasswordEmailRequest" )
}
localVarPostBody = & localVarOptionalSendResetPasswordEmailRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v SendResetPasswordEmailResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}
// UpdateAccountOpts Optional parameters for the method 'UpdateAccount'
type UpdateAccountOpts struct {
2021-04-20 11:18:45 -04:00
UpdateAccountRequest optional . Interface
2020-10-13 11:17:37 -04:00
}
/ *
UpdateAccount Method for UpdateAccount
* @ param ctx _context . Context - for authentication , logging , cancellation , deadlines , tracing , etc . Passed from http . Request or context . Background ( ) .
* @ param optional nil or * UpdateAccountOpts - Optional Parameters :
2021-04-20 11:18:45 -04:00
* @ param "UpdateAccountRequest" ( optional . Interface of UpdateAccountRequest ) -
2020-10-13 11:17:37 -04:00
@ return UpdateAccountResponse
* /
func ( a * AccountApiService ) UpdateAccount ( ctx _context . Context , localVarOptionals * UpdateAccountOpts ) ( UpdateAccountResponse , * _nethttp . Response , error ) {
var (
localVarHTTPMethod = _nethttp . MethodPost
localVarPostBody interface { }
localVarFormFileName string
localVarFileName string
localVarFileBytes [ ] byte
localVarReturnValue UpdateAccountResponse
)
// create path and map variables
localVarPath := a . client . cfg . BasePath + "/UpdateAccount"
localVarHeaderParams := make ( map [ string ] string )
localVarQueryParams := _neturl . Values { }
localVarFormParams := _neturl . Values { }
// 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
}
// body params
if localVarOptionals != nil && localVarOptionals . UpdateAccountRequest . IsSet ( ) {
localVarOptionalUpdateAccountRequest , localVarOptionalUpdateAccountRequestok := localVarOptionals . UpdateAccountRequest . Value ( ) . ( UpdateAccountRequest )
if ! localVarOptionalUpdateAccountRequestok {
return localVarReturnValue , nil , reportError ( "updateAccountRequest should be UpdateAccountRequest" )
}
localVarPostBody = & localVarOptionalUpdateAccountRequest
}
if ctx != nil {
// API Key Authentication
if auth , ok := ctx . Value ( ContextAPIKey ) . ( APIKey ) ; ok {
var key string
if auth . Prefix != "" {
key = auth . Prefix + " " + auth . Key
} else {
key = auth . Key
}
localVarHeaderParams [ "Authorization" ] = key
}
}
r , err := a . client . prepareRequest ( ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , localVarFormFileName , localVarFileName , localVarFileBytes )
if err != nil {
return localVarReturnValue , nil , err
}
localVarHTTPResponse , err := a . client . callAPI ( r )
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue , localVarHTTPResponse , err
}
localVarBody , err := _ioutil . ReadAll ( localVarHTTPResponse . Body )
localVarHTTPResponse . Body . Close ( )
if err != nil {
return localVarReturnValue , localVarHTTPResponse , err
}
if localVarHTTPResponse . StatusCode >= 300 {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : localVarHTTPResponse . Status ,
}
if localVarHTTPResponse . StatusCode == 200 {
var v UpdateAccountResponse
err = a . client . decode ( & v , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr . error = err . Error ( )
return localVarReturnValue , localVarHTTPResponse , newErr
}
newErr . model = v
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
err = a . client . decode ( & localVarReturnValue , localVarBody , localVarHTTPResponse . Header . Get ( "Content-Type" ) )
if err != nil {
newErr := GenericOpenAPIError {
body : localVarBody ,
error : err . Error ( ) ,
}
return localVarReturnValue , localVarHTTPResponse , newErr
}
return localVarReturnValue , localVarHTTPResponse , nil
}