From 5fa3e4f7e1fc24ed96c1bfb9f1d382a5756028a3 Mon Sep 17 00:00:00 2001 From: pipeline-anypoint-clients-generator Date: Mon, 5 Feb 2024 10:50:36 +0000 Subject: [PATCH] Generates modules from pipeline. --- connected_app/.openapi-generator/FILES | 12 +- connected_app/README.md | 20 +- connected_app/api/openapi.yaml | 172 +++++- connected_app/api_default.go | 488 +++++++++++------- .../docs/CreateConnectedApp400Response.md | 82 +++ connected_app/docs/DefaultApi.md | 202 +++++--- .../docs/GetAllConnectedApps200Response.md | 82 +++ .../docs/GetConnectedAppScopes200Response.md | 82 +++ ...model_create_connected_app_400_response.go | 166 ++++++ ...del_get_all_connected_apps_200_response.go | 162 ++++++ ...l_get_connected_app_scopes_200_response.go | 162 ++++++ 11 files changed, 1327 insertions(+), 303 deletions(-) create mode 100644 connected_app/docs/CreateConnectedApp400Response.md create mode 100644 connected_app/docs/GetAllConnectedApps200Response.md create mode 100644 connected_app/docs/GetConnectedAppScopes200Response.md create mode 100644 connected_app/model_create_connected_app_400_response.go create mode 100644 connected_app/model_get_all_connected_apps_200_response.go create mode 100644 connected_app/model_get_connected_app_scopes_200_response.go diff --git a/connected_app/.openapi-generator/FILES b/connected_app/.openapi-generator/FILES index 2980689..7bcc6a0 100644 --- a/connected_app/.openapi-generator/FILES +++ b/connected_app/.openapi-generator/FILES @@ -11,18 +11,15 @@ docs/ConnectedAppPatchExtAllOf.md docs/ConnectedAppRespExt.md docs/ConnectedAppRespExtAllOf.md docs/ConnectedAppScopesPutBody.md -docs/ConnectedApplicationsConnAppIdScopesGet200Response.md -docs/ConnectedApplicationsGet200Response.md -docs/ConnectedApplicationsPost400Response.md docs/ContextParams.md +docs/CreateConnectedApp400Response.md docs/DefaultApi.md +docs/GetAllConnectedApps200Response.md +docs/GetConnectedAppScopes200Response.md docs/ScopeCore.md git_push.sh go.mod go.sum -model__connected_applications__conn_app_id__scopes_get_200_response.go -model__connected_applications_get_200_response.go -model__connected_applications_post_400_response.go model_connected_app_core.go model_connected_app_patch_ext.go model_connected_app_patch_ext_all_of.go @@ -30,6 +27,9 @@ model_connected_app_resp_ext.go model_connected_app_resp_ext_all_of.go model_connected_app_scopes_put_body.go model_context_params.go +model_create_connected_app_400_response.go +model_get_all_connected_apps_200_response.go +model_get_connected_app_scopes_200_response.go model_scope_core.go response.go utils.go diff --git a/connected_app/README.md b/connected_app/README.md index 74ed05f..7b50df6 100644 --- a/connected_app/README.md +++ b/connected_app/README.md @@ -77,13 +77,13 @@ All URIs are relative to *https://anypoint.mulesoft.com/accounts/api* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DefaultApi* | [**ConnectedApplicationsConnAppIdDelete**](docs/DefaultApi.md#connectedapplicationsconnappiddelete) | **Delete** /connectedApplications/{connAppId} | -*DefaultApi* | [**ConnectedApplicationsConnAppIdGet**](docs/DefaultApi.md#connectedapplicationsconnappidget) | **Get** /connectedApplications/{connAppId} | -*DefaultApi* | [**ConnectedApplicationsConnAppIdPatch**](docs/DefaultApi.md#connectedapplicationsconnappidpatch) | **Patch** /connectedApplications/{connAppId} | -*DefaultApi* | [**ConnectedApplicationsConnAppIdScopesGet**](docs/DefaultApi.md#connectedapplicationsconnappidscopesget) | **Get** /connectedApplications/{connAppId}/scopes | -*DefaultApi* | [**ConnectedApplicationsConnAppIdScopesPut**](docs/DefaultApi.md#connectedapplicationsconnappidscopesput) | **Put** /connectedApplications/{connAppId}/scopes | -*DefaultApi* | [**ConnectedApplicationsGet**](docs/DefaultApi.md#connectedapplicationsget) | **Get** /connectedApplications | -*DefaultApi* | [**ConnectedApplicationsPost**](docs/DefaultApi.md#connectedapplicationspost) | **Post** /connectedApplications | +*DefaultApi* | [**CreateConnectedApp**](docs/DefaultApi.md#createconnectedapp) | **Post** /organizations/{orgId}/connectedApplications | +*DefaultApi* | [**DeleteConnectedApp**](docs/DefaultApi.md#deleteconnectedapp) | **Delete** /organizations/{orgId}/connectedApplications/{connAppId} | +*DefaultApi* | [**GetAllConnectedApps**](docs/DefaultApi.md#getallconnectedapps) | **Get** /connectedApplications | +*DefaultApi* | [**GetConnectedApp**](docs/DefaultApi.md#getconnectedapp) | **Get** /organizations/{orgId}/connectedApplications/{connAppId} | +*DefaultApi* | [**GetConnectedAppScopes**](docs/DefaultApi.md#getconnectedappscopes) | **Get** /organizations/{orgId}/connectedApplications/{connAppId}/scopes | +*DefaultApi* | [**UpdateConnectedApp**](docs/DefaultApi.md#updateconnectedapp) | **Patch** /organizations/{orgId}/connectedApplications/{connAppId} | +*DefaultApi* | [**UpdateConnectedAppScopes**](docs/DefaultApi.md#updateconnectedappscopes) | **Put** /organizations/{orgId}/connectedApplications/{connAppId}/scopes | ## Documentation For Models @@ -94,10 +94,10 @@ Class | Method | HTTP request | Description - [ConnectedAppRespExt](docs/ConnectedAppRespExt.md) - [ConnectedAppRespExtAllOf](docs/ConnectedAppRespExtAllOf.md) - [ConnectedAppScopesPutBody](docs/ConnectedAppScopesPutBody.md) - - [ConnectedApplicationsConnAppIdScopesGet200Response](docs/ConnectedApplicationsConnAppIdScopesGet200Response.md) - - [ConnectedApplicationsGet200Response](docs/ConnectedApplicationsGet200Response.md) - - [ConnectedApplicationsPost400Response](docs/ConnectedApplicationsPost400Response.md) - [ContextParams](docs/ContextParams.md) + - [CreateConnectedApp400Response](docs/CreateConnectedApp400Response.md) + - [GetAllConnectedApps200Response](docs/GetAllConnectedApps200Response.md) + - [GetConnectedAppScopes200Response](docs/GetConnectedAppScopes200Response.md) - [ScopeCore](docs/ScopeCore.md) diff --git a/connected_app/api/openapi.yaml b/connected_app/api/openapi.yaml index ba536ac..2d340e9 100644 --- a/connected_app/api/openapi.yaml +++ b/connected_app/api/openapi.yaml @@ -15,7 +15,50 @@ security: paths: /connectedApplications: get: - description: Returns all connected apps + description: Get all connected applications for the organization + operationId: GetAllConnectedApps + parameters: + - description: flag to indicate whether to return usage statistics + explode: true + in: query + name: includeUsage + required: false + schema: + type: boolean + style: form + - description: Provide an orgId to get all clients from other organization + explode: true + in: query + name: orgId + required: false + schema: + type: string + style: form + - description: The number of records to omit from the response. + explode: true + in: query + name: offset + required: false + schema: + type: integer + style: form + - description: Maximum records to retrieve per request. + explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - description: A search string to use for case-insensitive partial matches on + all object properties. + explode: true + in: query + name: search + required: false + schema: + type: string + style: form responses: "401": description: Access token is missing or invalid @@ -23,10 +66,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications_get_200_response' + $ref: '#/components/schemas/GetAllConnectedApps_200_response' description: Success response + /organizations/{orgId}/connectedApplications: post: - description: create a Connected App + description: Create a new connected application + operationId: CreateConnectedApp + parameters: + - description: The ID of the organization + explode: false + in: path + name: orgId + required: true + schema: + type: string + style: simple requestBody: content: application/json: @@ -39,7 +93,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications_post_400_response' + $ref: '#/components/schemas/CreateConnectedApp_400_response' description: Bad request response "201": content: @@ -47,10 +101,19 @@ paths: schema: $ref: '#/components/schemas/connectedAppRespExt' description: Success post response - /connectedApplications/{connAppId}: + /organizations/{orgId}/connectedApplications/{connAppId}: delete: - description: deletes a Connected App + description: Deletes a single connected application + operationId: DeleteConnectedApp parameters: + - description: The ID of the organization + explode: false + in: path + name: orgId + required: true + schema: + type: string + style: simple - description: The ID of the connected app explode: false in: path @@ -65,8 +128,17 @@ paths: "204": description: Success delete response get: - description: Returns all connected apps + description: Get a single connected application + operationId: GetConnectedApp parameters: + - description: The ID of the organization + explode: false + in: path + name: orgId + required: true + schema: + type: string + style: simple - description: The ID of the connected app explode: false in: path @@ -75,6 +147,14 @@ paths: schema: type: string style: simple + - description: flag to indicate whether to return usage statistics + explode: true + in: query + name: includeUsage + required: false + schema: + type: boolean + style: form responses: "401": description: Access token is missing or invalid @@ -85,8 +165,17 @@ paths: $ref: '#/components/schemas/connectedAppRespExt' description: Success get response patch: - description: patches a Connected App + description: Patches a single connected application + operationId: UpdateConnectedApp parameters: + - description: The ID of the organization + explode: false + in: path + name: orgId + required: true + schema: + type: string + style: simple - description: The ID of the connected app explode: false in: path @@ -95,6 +184,14 @@ paths: schema: type: string style: simple + - description: Asks service to reset secret as part of this operation + explode: true + in: query + name: resetSecret + required: false + schema: + type: boolean + style: form requestBody: content: application/json: @@ -107,7 +204,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications_post_400_response' + $ref: '#/components/schemas/CreateConnectedApp_400_response' description: Bad request response "200": content: @@ -115,10 +212,19 @@ paths: schema: $ref: '#/components/schemas/connectedAppRespExt' description: Success patch response - /connectedApplications/{connAppId}/scopes: + /organizations/{orgId}/connectedApplications/{connAppId}/scopes: get: - description: Returns all scopes of a Connected App + description: Retrieves context-aware scopes assigned to the connected application + operationId: GetConnectedAppScopes parameters: + - description: The ID of the organization + explode: false + in: path + name: orgId + required: true + schema: + type: string + style: simple - description: The ID of the connected app explode: false in: path @@ -127,6 +233,22 @@ paths: schema: type: string style: simple + - description: The number of records to omit from the response. + explode: true + in: query + name: offset + required: false + schema: + type: integer + style: form + - description: Maximum records to retrieve per request. + explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form responses: "401": description: Access token is missing or invalid @@ -134,11 +256,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications__connAppId__scopes_get_200_response' + $ref: '#/components/schemas/GetConnectedAppScopes_200_response' description: Success get scopes response put: - description: replace a Connected App scopes + description: Replaces the entire list of context-aware scopes assigned to the + connected application + operationId: UpdateConnectedAppScopes parameters: + - description: The ID of the organization + explode: false + in: path + name: orgId + required: true + schema: + type: string + style: simple - description: The ID of the connected app explode: false in: path @@ -159,7 +291,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications_post_400_response' + $ref: '#/components/schemas/CreateConnectedApp_400_response' description: Bad request response "204": description: Success scopes put response @@ -171,13 +303,13 @@ components: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications_post_400_response' + $ref: '#/components/schemas/CreateConnectedApp_400_response' description: Bad request response SuccessListConnApps: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications_get_200_response' + $ref: '#/components/schemas/GetAllConnectedApps_200_response' description: Success response SuccessPostConnApps: content: @@ -203,7 +335,7 @@ components: content: application/json: schema: - $ref: '#/components/schemas/_connectedApplications__connAppId__scopes_get_200_response' + $ref: '#/components/schemas/GetConnectedAppScopes_200_response' description: Success get scopes response SuccessPutConnAppsScopes: description: Success scopes put response @@ -284,7 +416,7 @@ components: type: array title: connectedAppScopesPutBody type: object - _connectedApplications_get_200_response: + GetAllConnectedApps_200_response: example: total: 0 data: @@ -300,7 +432,7 @@ components: title: total type: integer type: object - _connectedApplications_post_400_response: + CreateConnectedApp_400_response: properties: status: default: 400 @@ -311,7 +443,7 @@ components: title: the error message type: string type: object - _connectedApplications__connAppId__scopes_get_200_response: + GetConnectedAppScopes_200_response: example: total: 0 data: diff --git a/connected_app/api_default.go b/connected_app/api_default.go index 4c1ebf6..384dd18 100644 --- a/connected_app/api_default.go +++ b/connected_app/api_default.go @@ -23,55 +23,63 @@ import ( // DefaultApiService DefaultApi service type DefaultApiService service -type DefaultApiConnectedApplicationsConnAppIdDeleteRequest struct { +type DefaultApiCreateConnectedAppRequest struct { ctx context.Context ApiService *DefaultApiService - connAppId string + orgId string + connectedAppCore *ConnectedAppCore +} + +func (r DefaultApiCreateConnectedAppRequest) ConnectedAppCore(connectedAppCore ConnectedAppCore) DefaultApiCreateConnectedAppRequest { + r.connectedAppCore = &connectedAppCore + return r } -func (r DefaultApiConnectedApplicationsConnAppIdDeleteRequest) Execute() (*http.Response, error) { - return r.ApiService.ConnectedApplicationsConnAppIdDeleteExecute(r) +func (r DefaultApiCreateConnectedAppRequest) Execute() (*ConnectedAppRespExt, *http.Response, error) { + return r.ApiService.CreateConnectedAppExecute(r) } /* -ConnectedApplicationsConnAppIdDelete Method for ConnectedApplicationsConnAppIdDelete +CreateConnectedApp Method for CreateConnectedApp -deletes a Connected App +Create a new connected application @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param connAppId The ID of the connected app - @return DefaultApiConnectedApplicationsConnAppIdDeleteRequest + @param orgId The ID of the organization + @return DefaultApiCreateConnectedAppRequest */ -func (a *DefaultApiService) ConnectedApplicationsConnAppIdDelete(ctx context.Context, connAppId string) DefaultApiConnectedApplicationsConnAppIdDeleteRequest { - return DefaultApiConnectedApplicationsConnAppIdDeleteRequest{ +func (a *DefaultApiService) CreateConnectedApp(ctx context.Context, orgId string) DefaultApiCreateConnectedAppRequest { + return DefaultApiCreateConnectedAppRequest{ ApiService: a, ctx: ctx, - connAppId: connAppId, + orgId: orgId, } } // Execute executes the request -func (a *DefaultApiService) ConnectedApplicationsConnAppIdDeleteExecute(r DefaultApiConnectedApplicationsConnAppIdDeleteRequest) (*http.Response, error) { +// @return ConnectedAppRespExt +func (a *DefaultApiService) CreateConnectedAppExecute(r DefaultApiCreateConnectedAppRequest) (*ConnectedAppRespExt, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile + localVarReturnValue *ConnectedAppRespExt ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsConnAppIdDelete") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateConnectedApp") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications/{connAppId}" - localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) + localVarPath := localBasePath + "/organizations/{orgId}/connectedApplications" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(parameterValueToString(r.orgId, "orgId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -80,28 +88,30 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdDeleteExecute(r Defaul } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.connectedAppCore req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -109,55 +119,77 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdDeleteExecute(r Defaul body: localVarBody, error: localVarHTTPResponse.Status, } - return localVarHTTPResponse, newErr + if localVarHTTPResponse.StatusCode == 400 { + var v CreateConnectedApp400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + 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 } -type DefaultApiConnectedApplicationsConnAppIdGetRequest struct { +type DefaultApiDeleteConnectedAppRequest struct { ctx context.Context ApiService *DefaultApiService + orgId string connAppId string } -func (r DefaultApiConnectedApplicationsConnAppIdGetRequest) Execute() (*ConnectedAppRespExt, *http.Response, error) { - return r.ApiService.ConnectedApplicationsConnAppIdGetExecute(r) +func (r DefaultApiDeleteConnectedAppRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteConnectedAppExecute(r) } /* -ConnectedApplicationsConnAppIdGet Method for ConnectedApplicationsConnAppIdGet +DeleteConnectedApp Method for DeleteConnectedApp -Returns all connected apps +Deletes a single connected application @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId The ID of the organization @param connAppId The ID of the connected app - @return DefaultApiConnectedApplicationsConnAppIdGetRequest + @return DefaultApiDeleteConnectedAppRequest */ -func (a *DefaultApiService) ConnectedApplicationsConnAppIdGet(ctx context.Context, connAppId string) DefaultApiConnectedApplicationsConnAppIdGetRequest { - return DefaultApiConnectedApplicationsConnAppIdGetRequest{ +func (a *DefaultApiService) DeleteConnectedApp(ctx context.Context, orgId string, connAppId string) DefaultApiDeleteConnectedAppRequest { + return DefaultApiDeleteConnectedAppRequest{ ApiService: a, ctx: ctx, + orgId: orgId, connAppId: connAppId, } } // Execute executes the request -// @return ConnectedAppRespExt -func (a *DefaultApiService) ConnectedApplicationsConnAppIdGetExecute(r DefaultApiConnectedApplicationsConnAppIdGetRequest) (*ConnectedAppRespExt, *http.Response, error) { +func (a *DefaultApiService) DeleteConnectedAppExecute(r DefaultApiDeleteConnectedAppRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ConnectedAppRespExt ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsConnAppIdGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteConnectedApp") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications/{connAppId}" + localVarPath := localBasePath + "/organizations/{orgId}/connectedApplications/{connAppId}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(parameterValueToString(r.orgId, "orgId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) localVarHeaderParams := make(map[string]string) @@ -174,7 +206,7 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdGetExecute(r DefaultAp } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} + localVarHTTPHeaderAccepts := []string{} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -183,19 +215,19 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdGetExecute(r DefaultAp } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -203,78 +235,109 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdGetExecute(r DefaultAp body: localVarBody, error: localVarHTTPResponse.Status, } - 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 localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type DefaultApiConnectedApplicationsConnAppIdPatchRequest struct { +type DefaultApiGetAllConnectedAppsRequest struct { ctx context.Context ApiService *DefaultApiService - connAppId string - connectedAppPatchExt *ConnectedAppPatchExt + includeUsage *bool + orgId *string + offset *int32 + limit *int32 + search *string } -func (r DefaultApiConnectedApplicationsConnAppIdPatchRequest) ConnectedAppPatchExt(connectedAppPatchExt ConnectedAppPatchExt) DefaultApiConnectedApplicationsConnAppIdPatchRequest { - r.connectedAppPatchExt = &connectedAppPatchExt +// flag to indicate whether to return usage statistics +func (r DefaultApiGetAllConnectedAppsRequest) IncludeUsage(includeUsage bool) DefaultApiGetAllConnectedAppsRequest { + r.includeUsage = &includeUsage + return r +} + +// Provide an orgId to get all clients from other organization +func (r DefaultApiGetAllConnectedAppsRequest) OrgId(orgId string) DefaultApiGetAllConnectedAppsRequest { + r.orgId = &orgId + return r +} + +// The number of records to omit from the response. +func (r DefaultApiGetAllConnectedAppsRequest) Offset(offset int32) DefaultApiGetAllConnectedAppsRequest { + r.offset = &offset + return r +} + +// Maximum records to retrieve per request. +func (r DefaultApiGetAllConnectedAppsRequest) Limit(limit int32) DefaultApiGetAllConnectedAppsRequest { + r.limit = &limit + return r +} + +// A search string to use for case-insensitive partial matches on all object properties. +func (r DefaultApiGetAllConnectedAppsRequest) Search(search string) DefaultApiGetAllConnectedAppsRequest { + r.search = &search return r } -func (r DefaultApiConnectedApplicationsConnAppIdPatchRequest) Execute() (*ConnectedAppRespExt, *http.Response, error) { - return r.ApiService.ConnectedApplicationsConnAppIdPatchExecute(r) +func (r DefaultApiGetAllConnectedAppsRequest) Execute() (*GetAllConnectedApps200Response, *http.Response, error) { + return r.ApiService.GetAllConnectedAppsExecute(r) } /* -ConnectedApplicationsConnAppIdPatch Method for ConnectedApplicationsConnAppIdPatch +GetAllConnectedApps Method for GetAllConnectedApps -patches a Connected App +Get all connected applications for the organization @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param connAppId The ID of the connected app - @return DefaultApiConnectedApplicationsConnAppIdPatchRequest + @return DefaultApiGetAllConnectedAppsRequest */ -func (a *DefaultApiService) ConnectedApplicationsConnAppIdPatch(ctx context.Context, connAppId string) DefaultApiConnectedApplicationsConnAppIdPatchRequest { - return DefaultApiConnectedApplicationsConnAppIdPatchRequest{ +func (a *DefaultApiService) GetAllConnectedApps(ctx context.Context) DefaultApiGetAllConnectedAppsRequest { + return DefaultApiGetAllConnectedAppsRequest{ ApiService: a, ctx: ctx, - connAppId: connAppId, } } // Execute executes the request -// @return ConnectedAppRespExt -func (a *DefaultApiService) ConnectedApplicationsConnAppIdPatchExecute(r DefaultApiConnectedApplicationsConnAppIdPatchRequest) (*ConnectedAppRespExt, *http.Response, error) { +// @return GetAllConnectedApps200Response +func (a *DefaultApiService) GetAllConnectedAppsExecute(r DefaultApiGetAllConnectedAppsRequest) (*GetAllConnectedApps200Response, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPatch + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ConnectedAppRespExt + localVarReturnValue *GetAllConnectedApps200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsConnAppIdPatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetAllConnectedApps") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications/{connAppId}" - localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) + localVarPath := localBasePath + "/connectedApplications" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.includeUsage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeUsage", r.includeUsage, "") + } + if r.orgId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "orgId", r.orgId, "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -290,8 +353,6 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdPatchExecute(r Default if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.connectedAppPatchExt req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -314,17 +375,6 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdPatchExecute(r Default body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ConnectedApplicationsPost400Response - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -340,55 +390,69 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdPatchExecute(r Default return localVarReturnValue, localVarHTTPResponse, nil } -type DefaultApiConnectedApplicationsConnAppIdScopesGetRequest struct { +type DefaultApiGetConnectedAppRequest struct { ctx context.Context ApiService *DefaultApiService + orgId string connAppId string + includeUsage *bool } -func (r DefaultApiConnectedApplicationsConnAppIdScopesGetRequest) Execute() (*ConnectedApplicationsConnAppIdScopesGet200Response, *http.Response, error) { - return r.ApiService.ConnectedApplicationsConnAppIdScopesGetExecute(r) +// flag to indicate whether to return usage statistics +func (r DefaultApiGetConnectedAppRequest) IncludeUsage(includeUsage bool) DefaultApiGetConnectedAppRequest { + r.includeUsage = &includeUsage + return r +} + +func (r DefaultApiGetConnectedAppRequest) Execute() (*ConnectedAppRespExt, *http.Response, error) { + return r.ApiService.GetConnectedAppExecute(r) } /* -ConnectedApplicationsConnAppIdScopesGet Method for ConnectedApplicationsConnAppIdScopesGet +GetConnectedApp Method for GetConnectedApp -Returns all scopes of a Connected App +Get a single connected application @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId The ID of the organization @param connAppId The ID of the connected app - @return DefaultApiConnectedApplicationsConnAppIdScopesGetRequest + @return DefaultApiGetConnectedAppRequest */ -func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesGet(ctx context.Context, connAppId string) DefaultApiConnectedApplicationsConnAppIdScopesGetRequest { - return DefaultApiConnectedApplicationsConnAppIdScopesGetRequest{ +func (a *DefaultApiService) GetConnectedApp(ctx context.Context, orgId string, connAppId string) DefaultApiGetConnectedAppRequest { + return DefaultApiGetConnectedAppRequest{ ApiService: a, ctx: ctx, + orgId: orgId, connAppId: connAppId, } } // Execute executes the request -// @return ConnectedApplicationsConnAppIdScopesGet200Response -func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesGetExecute(r DefaultApiConnectedApplicationsConnAppIdScopesGetRequest) (*ConnectedApplicationsConnAppIdScopesGet200Response, *http.Response, error) { +// @return ConnectedAppRespExt +func (a *DefaultApiService) GetConnectedAppExecute(r DefaultApiGetConnectedAppRequest) (*ConnectedAppRespExt, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ConnectedApplicationsConnAppIdScopesGet200Response + localVarReturnValue *ConnectedAppRespExt ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsConnAppIdScopesGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetConnectedApp") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications/{connAppId}/scopes" + localVarPath := localBasePath + "/organizations/{orgId}/connectedApplications/{connAppId}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(parameterValueToString(r.orgId, "orgId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.includeUsage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeUsage", r.includeUsage, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -443,61 +507,81 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesGetExecute(r Def return localVarReturnValue, localVarHTTPResponse, nil } -type DefaultApiConnectedApplicationsConnAppIdScopesPutRequest struct { +type DefaultApiGetConnectedAppScopesRequest struct { ctx context.Context ApiService *DefaultApiService + orgId string connAppId string - connectedAppScopesPutBody *ConnectedAppScopesPutBody + offset *int32 + limit *int32 } -func (r DefaultApiConnectedApplicationsConnAppIdScopesPutRequest) ConnectedAppScopesPutBody(connectedAppScopesPutBody ConnectedAppScopesPutBody) DefaultApiConnectedApplicationsConnAppIdScopesPutRequest { - r.connectedAppScopesPutBody = &connectedAppScopesPutBody +// The number of records to omit from the response. +func (r DefaultApiGetConnectedAppScopesRequest) Offset(offset int32) DefaultApiGetConnectedAppScopesRequest { + r.offset = &offset return r } -func (r DefaultApiConnectedApplicationsConnAppIdScopesPutRequest) Execute() (*http.Response, error) { - return r.ApiService.ConnectedApplicationsConnAppIdScopesPutExecute(r) +// Maximum records to retrieve per request. +func (r DefaultApiGetConnectedAppScopesRequest) Limit(limit int32) DefaultApiGetConnectedAppScopesRequest { + r.limit = &limit + return r +} + +func (r DefaultApiGetConnectedAppScopesRequest) Execute() (*GetConnectedAppScopes200Response, *http.Response, error) { + return r.ApiService.GetConnectedAppScopesExecute(r) } /* -ConnectedApplicationsConnAppIdScopesPut Method for ConnectedApplicationsConnAppIdScopesPut +GetConnectedAppScopes Method for GetConnectedAppScopes -replace a Connected App scopes +Retrieves context-aware scopes assigned to the connected application @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orgId The ID of the organization @param connAppId The ID of the connected app - @return DefaultApiConnectedApplicationsConnAppIdScopesPutRequest + @return DefaultApiGetConnectedAppScopesRequest */ -func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesPut(ctx context.Context, connAppId string) DefaultApiConnectedApplicationsConnAppIdScopesPutRequest { - return DefaultApiConnectedApplicationsConnAppIdScopesPutRequest{ +func (a *DefaultApiService) GetConnectedAppScopes(ctx context.Context, orgId string, connAppId string) DefaultApiGetConnectedAppScopesRequest { + return DefaultApiGetConnectedAppScopesRequest{ ApiService: a, ctx: ctx, + orgId: orgId, connAppId: connAppId, } } // Execute executes the request -func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesPutExecute(r DefaultApiConnectedApplicationsConnAppIdScopesPutRequest) (*http.Response, error) { +// @return GetConnectedAppScopes200Response +func (a *DefaultApiService) GetConnectedAppScopesExecute(r DefaultApiGetConnectedAppScopesRequest) (*GetConnectedAppScopes200Response, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodPut + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile + localVarReturnValue *GetConnectedAppScopes200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsConnAppIdScopesPut") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetConnectedAppScopes") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications/{connAppId}/scopes" + localVarPath := localBasePath + "/organizations/{orgId}/connectedApplications/{connAppId}/scopes" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(parameterValueToString(r.orgId, "orgId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "") + } + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -513,23 +597,21 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesPutExecute(r Def if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.connectedAppScopesPutBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -537,70 +619,92 @@ func (a *DefaultApiService) ConnectedApplicationsConnAppIdScopesPutExecute(r Def body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ConnectedApplicationsPost400Response - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr + 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 localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + return localVarReturnValue, localVarHTTPResponse, nil } -type DefaultApiConnectedApplicationsGetRequest struct { +type DefaultApiUpdateConnectedAppRequest struct { ctx context.Context ApiService *DefaultApiService + orgId string + connAppId string + resetSecret *bool + connectedAppPatchExt *ConnectedAppPatchExt } -func (r DefaultApiConnectedApplicationsGetRequest) Execute() (*ConnectedApplicationsGet200Response, *http.Response, error) { - return r.ApiService.ConnectedApplicationsGetExecute(r) +// Asks service to reset secret as part of this operation +func (r DefaultApiUpdateConnectedAppRequest) ResetSecret(resetSecret bool) DefaultApiUpdateConnectedAppRequest { + r.resetSecret = &resetSecret + return r +} + +func (r DefaultApiUpdateConnectedAppRequest) ConnectedAppPatchExt(connectedAppPatchExt ConnectedAppPatchExt) DefaultApiUpdateConnectedAppRequest { + r.connectedAppPatchExt = &connectedAppPatchExt + return r +} + +func (r DefaultApiUpdateConnectedAppRequest) Execute() (*ConnectedAppRespExt, *http.Response, error) { + return r.ApiService.UpdateConnectedAppExecute(r) } /* -ConnectedApplicationsGet Method for ConnectedApplicationsGet +UpdateConnectedApp Method for UpdateConnectedApp -Returns all connected apps +Patches a single connected application @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DefaultApiConnectedApplicationsGetRequest + @param orgId The ID of the organization + @param connAppId The ID of the connected app + @return DefaultApiUpdateConnectedAppRequest */ -func (a *DefaultApiService) ConnectedApplicationsGet(ctx context.Context) DefaultApiConnectedApplicationsGetRequest { - return DefaultApiConnectedApplicationsGetRequest{ +func (a *DefaultApiService) UpdateConnectedApp(ctx context.Context, orgId string, connAppId string) DefaultApiUpdateConnectedAppRequest { + return DefaultApiUpdateConnectedAppRequest{ ApiService: a, ctx: ctx, + orgId: orgId, + connAppId: connAppId, } } // Execute executes the request -// @return ConnectedApplicationsGet200Response -func (a *DefaultApiService) ConnectedApplicationsGetExecute(r DefaultApiConnectedApplicationsGetRequest) (*ConnectedApplicationsGet200Response, *http.Response, error) { +// @return ConnectedAppRespExt +func (a *DefaultApiService) UpdateConnectedAppExecute(r DefaultApiUpdateConnectedAppRequest) (*ConnectedAppRespExt, *http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ConnectedApplicationsGet200Response + localVarReturnValue *ConnectedAppRespExt ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsGet") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateConnectedApp") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications" + localVarPath := localBasePath + "/organizations/{orgId}/connectedApplications/{connAppId}" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(parameterValueToString(r.orgId, "orgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.resetSecret != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "resetSecret", r.resetSecret, "") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -616,6 +720,8 @@ func (a *DefaultApiService) ConnectedApplicationsGetExecute(r DefaultApiConnecte if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.connectedAppPatchExt req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -638,6 +744,17 @@ func (a *DefaultApiService) ConnectedApplicationsGetExecute(r DefaultApiConnecte body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v CreateConnectedApp400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -653,52 +770,58 @@ func (a *DefaultApiService) ConnectedApplicationsGetExecute(r DefaultApiConnecte return localVarReturnValue, localVarHTTPResponse, nil } -type DefaultApiConnectedApplicationsPostRequest struct { +type DefaultApiUpdateConnectedAppScopesRequest struct { ctx context.Context ApiService *DefaultApiService - connectedAppCore *ConnectedAppCore + orgId string + connAppId string + connectedAppScopesPutBody *ConnectedAppScopesPutBody } -func (r DefaultApiConnectedApplicationsPostRequest) ConnectedAppCore(connectedAppCore ConnectedAppCore) DefaultApiConnectedApplicationsPostRequest { - r.connectedAppCore = &connectedAppCore +func (r DefaultApiUpdateConnectedAppScopesRequest) ConnectedAppScopesPutBody(connectedAppScopesPutBody ConnectedAppScopesPutBody) DefaultApiUpdateConnectedAppScopesRequest { + r.connectedAppScopesPutBody = &connectedAppScopesPutBody return r } -func (r DefaultApiConnectedApplicationsPostRequest) Execute() (*ConnectedAppRespExt, *http.Response, error) { - return r.ApiService.ConnectedApplicationsPostExecute(r) +func (r DefaultApiUpdateConnectedAppScopesRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateConnectedAppScopesExecute(r) } /* -ConnectedApplicationsPost Method for ConnectedApplicationsPost +UpdateConnectedAppScopes Method for UpdateConnectedAppScopes -create a Connected App +Replaces the entire list of context-aware scopes assigned to the connected application @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DefaultApiConnectedApplicationsPostRequest + @param orgId The ID of the organization + @param connAppId The ID of the connected app + @return DefaultApiUpdateConnectedAppScopesRequest */ -func (a *DefaultApiService) ConnectedApplicationsPost(ctx context.Context) DefaultApiConnectedApplicationsPostRequest { - return DefaultApiConnectedApplicationsPostRequest{ +func (a *DefaultApiService) UpdateConnectedAppScopes(ctx context.Context, orgId string, connAppId string) DefaultApiUpdateConnectedAppScopesRequest { + return DefaultApiUpdateConnectedAppScopesRequest{ ApiService: a, ctx: ctx, + orgId: orgId, + connAppId: connAppId, } } // Execute executes the request -// @return ConnectedAppRespExt -func (a *DefaultApiService) ConnectedApplicationsPostExecute(r DefaultApiConnectedApplicationsPostRequest) (*ConnectedAppRespExt, *http.Response, error) { +func (a *DefaultApiService) UpdateConnectedAppScopesExecute(r DefaultApiUpdateConnectedAppScopesRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ConnectedAppRespExt ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ConnectedApplicationsPost") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateConnectedAppScopes") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/connectedApplications" + localVarPath := localBasePath + "/organizations/{orgId}/connectedApplications/{connAppId}/scopes" + localVarPath = strings.Replace(localVarPath, "{"+"orgId"+"}", url.PathEscape(parameterValueToString(r.orgId, "orgId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"connAppId"+"}", url.PathEscape(parameterValueToString(r.connAppId, "connAppId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -722,22 +845,22 @@ func (a *DefaultApiService) ConnectedApplicationsPostExecute(r DefaultApiConnect localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.connectedAppCore + localVarPostBody = r.connectedAppScopesPutBody req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -746,27 +869,18 @@ func (a *DefaultApiService) ConnectedApplicationsPostExecute(r DefaultApiConnect error: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v ConnectedApplicationsPost400Response + var v CreateConnectedApp400Response err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - 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 localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } diff --git a/connected_app/docs/CreateConnectedApp400Response.md b/connected_app/docs/CreateConnectedApp400Response.md new file mode 100644 index 0000000..2ac7fbd --- /dev/null +++ b/connected_app/docs/CreateConnectedApp400Response.md @@ -0,0 +1,82 @@ +# CreateConnectedApp400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | Pointer to **int32** | | [optional] [default to 400] +**Message** | Pointer to **string** | | [optional] + +## Methods + +### NewCreateConnectedApp400Response + +`func NewCreateConnectedApp400Response() *CreateConnectedApp400Response` + +NewCreateConnectedApp400Response instantiates a new CreateConnectedApp400Response 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 + +### NewCreateConnectedApp400ResponseWithDefaults + +`func NewCreateConnectedApp400ResponseWithDefaults() *CreateConnectedApp400Response` + +NewCreateConnectedApp400ResponseWithDefaults instantiates a new CreateConnectedApp400Response 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 + +### GetStatus + +`func (o *CreateConnectedApp400Response) GetStatus() int32` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *CreateConnectedApp400Response) GetStatusOk() (*int32, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *CreateConnectedApp400Response) SetStatus(v int32)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *CreateConnectedApp400Response) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetMessage + +`func (o *CreateConnectedApp400Response) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *CreateConnectedApp400Response) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *CreateConnectedApp400Response) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *CreateConnectedApp400Response) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/connected_app/docs/DefaultApi.md b/connected_app/docs/DefaultApi.md index f26520f..3a4890f 100644 --- a/connected_app/docs/DefaultApi.md +++ b/connected_app/docs/DefaultApi.md @@ -4,19 +4,19 @@ All URIs are relative to *https://anypoint.mulesoft.com/accounts/api* Method | HTTP request | Description ------------- | ------------- | ------------- -[**ConnectedApplicationsConnAppIdDelete**](DefaultApi.md#ConnectedApplicationsConnAppIdDelete) | **Delete** /connectedApplications/{connAppId} | -[**ConnectedApplicationsConnAppIdGet**](DefaultApi.md#ConnectedApplicationsConnAppIdGet) | **Get** /connectedApplications/{connAppId} | -[**ConnectedApplicationsConnAppIdPatch**](DefaultApi.md#ConnectedApplicationsConnAppIdPatch) | **Patch** /connectedApplications/{connAppId} | -[**ConnectedApplicationsConnAppIdScopesGet**](DefaultApi.md#ConnectedApplicationsConnAppIdScopesGet) | **Get** /connectedApplications/{connAppId}/scopes | -[**ConnectedApplicationsConnAppIdScopesPut**](DefaultApi.md#ConnectedApplicationsConnAppIdScopesPut) | **Put** /connectedApplications/{connAppId}/scopes | -[**ConnectedApplicationsGet**](DefaultApi.md#ConnectedApplicationsGet) | **Get** /connectedApplications | -[**ConnectedApplicationsPost**](DefaultApi.md#ConnectedApplicationsPost) | **Post** /connectedApplications | +[**CreateConnectedApp**](DefaultApi.md#CreateConnectedApp) | **Post** /organizations/{orgId}/connectedApplications | +[**DeleteConnectedApp**](DefaultApi.md#DeleteConnectedApp) | **Delete** /organizations/{orgId}/connectedApplications/{connAppId} | +[**GetAllConnectedApps**](DefaultApi.md#GetAllConnectedApps) | **Get** /connectedApplications | +[**GetConnectedApp**](DefaultApi.md#GetConnectedApp) | **Get** /organizations/{orgId}/connectedApplications/{connAppId} | +[**GetConnectedAppScopes**](DefaultApi.md#GetConnectedAppScopes) | **Get** /organizations/{orgId}/connectedApplications/{connAppId}/scopes | +[**UpdateConnectedApp**](DefaultApi.md#UpdateConnectedApp) | **Patch** /organizations/{orgId}/connectedApplications/{connAppId} | +[**UpdateConnectedAppScopes**](DefaultApi.md#UpdateConnectedAppScopes) | **Put** /organizations/{orgId}/connectedApplications/{connAppId}/scopes | -## ConnectedApplicationsConnAppIdDelete +## CreateConnectedApp -> ConnectedApplicationsConnAppIdDelete(ctx, connAppId).Execute() +> ConnectedAppRespExt CreateConnectedApp(ctx, orgId).ConnectedAppCore(connectedAppCore).Execute() @@ -35,15 +35,18 @@ import ( ) func main() { - connAppId := "connAppId_example" // string | The ID of the connected app + orgId := "orgId_example" // string | The ID of the organization + connectedAppCore := *openapiclient.NewConnectedAppCore() // ConnectedAppCore | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultApi.ConnectedApplicationsConnAppIdDelete(context.Background(), connAppId).Execute() + resp, r, err := apiClient.DefaultApi.CreateConnectedApp(context.Background(), orgId).ConnectedAppCore(connectedAppCore).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsConnAppIdDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateConnectedApp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `CreateConnectedApp`: ConnectedAppRespExt + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateConnectedApp`: %v\n", resp) } ``` @@ -53,20 +56,21 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**connAppId** | **string** | The ID of the connected app | +**orgId** | **string** | The ID of the organization | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsConnAppIdDeleteRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateConnectedAppRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **connectedAppCore** | [**ConnectedAppCore**](ConnectedAppCore.md) | | ### Return type - (empty response body) +[**ConnectedAppRespExt**](ConnectedAppRespExt.md) ### Authorization @@ -74,17 +78,17 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined -- **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## ConnectedApplicationsConnAppIdGet +## DeleteConnectedApp -> ConnectedAppRespExt ConnectedApplicationsConnAppIdGet(ctx, connAppId).Execute() +> DeleteConnectedApp(ctx, orgId, connAppId).Execute() @@ -103,17 +107,16 @@ import ( ) func main() { + orgId := "orgId_example" // string | The ID of the organization connAppId := "connAppId_example" // string | The ID of the connected app configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ConnectedApplicationsConnAppIdGet(context.Background(), connAppId).Execute() + r, err := apiClient.DefaultApi.DeleteConnectedApp(context.Background(), orgId, connAppId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsConnAppIdGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteConnectedApp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ConnectedApplicationsConnAppIdGet`: ConnectedAppRespExt - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ConnectedApplicationsConnAppIdGet`: %v\n", resp) } ``` @@ -123,20 +126,22 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | The ID of the organization | **connAppId** | **string** | The ID of the connected app | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsConnAppIdGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteConnectedAppRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + ### Return type -[**ConnectedAppRespExt**](ConnectedAppRespExt.md) + (empty response body) ### Authorization @@ -145,16 +150,16 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## ConnectedApplicationsConnAppIdPatch +## GetAllConnectedApps -> ConnectedAppRespExt ConnectedApplicationsConnAppIdPatch(ctx, connAppId).ConnectedAppPatchExt(connectedAppPatchExt).Execute() +> GetAllConnectedApps200Response GetAllConnectedApps(ctx).IncludeUsage(includeUsage).OrgId(orgId).Offset(offset).Limit(limit).Search(search).Execute() @@ -173,42 +178,44 @@ import ( ) func main() { - connAppId := "connAppId_example" // string | The ID of the connected app - connectedAppPatchExt := *openapiclient.NewConnectedAppPatchExt() // ConnectedAppPatchExt | (optional) + includeUsage := true // bool | flag to indicate whether to return usage statistics (optional) + orgId := "orgId_example" // string | Provide an orgId to get all clients from other organization (optional) + offset := int32(56) // int32 | The number of records to omit from the response. (optional) + limit := int32(56) // int32 | Maximum records to retrieve per request. (optional) + search := "search_example" // string | A search string to use for case-insensitive partial matches on all object properties. (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ConnectedApplicationsConnAppIdPatch(context.Background(), connAppId).ConnectedAppPatchExt(connectedAppPatchExt).Execute() + resp, r, err := apiClient.DefaultApi.GetAllConnectedApps(context.Background()).IncludeUsage(includeUsage).OrgId(orgId).Offset(offset).Limit(limit).Search(search).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsConnAppIdPatch``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetAllConnectedApps``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ConnectedApplicationsConnAppIdPatch`: ConnectedAppRespExt - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ConnectedApplicationsConnAppIdPatch`: %v\n", resp) + // response from `GetAllConnectedApps`: GetAllConnectedApps200Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetAllConnectedApps`: %v\n", resp) } ``` ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**connAppId** | **string** | The ID of the connected app | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsConnAppIdPatchRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetAllConnectedAppsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - **connectedAppPatchExt** | [**ConnectedAppPatchExt**](ConnectedAppPatchExt.md) | | + **includeUsage** | **bool** | flag to indicate whether to return usage statistics | + **orgId** | **string** | Provide an orgId to get all clients from other organization | + **offset** | **int32** | The number of records to omit from the response. | + **limit** | **int32** | Maximum records to retrieve per request. | + **search** | **string** | A search string to use for case-insensitive partial matches on all object properties. | ### Return type -[**ConnectedAppRespExt**](ConnectedAppRespExt.md) +[**GetAllConnectedApps200Response**](GetAllConnectedApps200Response.md) ### Authorization @@ -216,7 +223,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -224,9 +231,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## ConnectedApplicationsConnAppIdScopesGet +## GetConnectedApp -> ConnectedApplicationsConnAppIdScopesGet200Response ConnectedApplicationsConnAppIdScopesGet(ctx, connAppId).Execute() +> ConnectedAppRespExt GetConnectedApp(ctx, orgId, connAppId).IncludeUsage(includeUsage).Execute() @@ -245,17 +252,19 @@ import ( ) func main() { + orgId := "orgId_example" // string | The ID of the organization connAppId := "connAppId_example" // string | The ID of the connected app + includeUsage := true // bool | flag to indicate whether to return usage statistics (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ConnectedApplicationsConnAppIdScopesGet(context.Background(), connAppId).Execute() + resp, r, err := apiClient.DefaultApi.GetConnectedApp(context.Background(), orgId, connAppId).IncludeUsage(includeUsage).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsConnAppIdScopesGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetConnectedApp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ConnectedApplicationsConnAppIdScopesGet`: ConnectedApplicationsConnAppIdScopesGet200Response - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ConnectedApplicationsConnAppIdScopesGet`: %v\n", resp) + // response from `GetConnectedApp`: ConnectedAppRespExt + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetConnectedApp`: %v\n", resp) } ``` @@ -265,20 +274,23 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | The ID of the organization | **connAppId** | **string** | The ID of the connected app | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsConnAppIdScopesGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetConnectedAppRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **includeUsage** | **bool** | flag to indicate whether to return usage statistics | + ### Return type -[**ConnectedApplicationsConnAppIdScopesGet200Response**](ConnectedApplicationsConnAppIdScopesGet200Response.md) +[**ConnectedAppRespExt**](ConnectedAppRespExt.md) ### Authorization @@ -294,9 +306,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## ConnectedApplicationsConnAppIdScopesPut +## GetConnectedAppScopes -> ConnectedApplicationsConnAppIdScopesPut(ctx, connAppId).ConnectedAppScopesPutBody(connectedAppScopesPutBody).Execute() +> GetConnectedAppScopes200Response GetConnectedAppScopes(ctx, orgId, connAppId).Offset(offset).Limit(limit).Execute() @@ -315,16 +327,20 @@ import ( ) func main() { + orgId := "orgId_example" // string | The ID of the organization connAppId := "connAppId_example" // string | The ID of the connected app - connectedAppScopesPutBody := *openapiclient.NewConnectedAppScopesPutBody() // ConnectedAppScopesPutBody | (optional) + offset := int32(56) // int32 | The number of records to omit from the response. (optional) + limit := int32(56) // int32 | Maximum records to retrieve per request. (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DefaultApi.ConnectedApplicationsConnAppIdScopesPut(context.Background(), connAppId).ConnectedAppScopesPutBody(connectedAppScopesPutBody).Execute() + resp, r, err := apiClient.DefaultApi.GetConnectedAppScopes(context.Background(), orgId, connAppId).Offset(offset).Limit(limit).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsConnAppIdScopesPut``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.GetConnectedAppScopes``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `GetConnectedAppScopes`: GetConnectedAppScopes200Response + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.GetConnectedAppScopes`: %v\n", resp) } ``` @@ -334,21 +350,24 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | The ID of the organization | **connAppId** | **string** | The ID of the connected app | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsConnAppIdScopesPutRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetConnectedAppScopesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **connectedAppScopesPutBody** | [**ConnectedAppScopesPutBody**](ConnectedAppScopesPutBody.md) | | + + **offset** | **int32** | The number of records to omit from the response. | + **limit** | **int32** | Maximum records to retrieve per request. | ### Return type - (empty response body) +[**GetConnectedAppScopes200Response**](GetConnectedAppScopes200Response.md) ### Authorization @@ -356,7 +375,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -364,9 +383,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## ConnectedApplicationsGet +## UpdateConnectedApp -> ConnectedApplicationsGet200Response ConnectedApplicationsGet(ctx).Execute() +> ConnectedAppRespExt UpdateConnectedApp(ctx, orgId, connAppId).ResetSecret(resetSecret).ConnectedAppPatchExt(connectedAppPatchExt).Execute() @@ -385,31 +404,47 @@ import ( ) func main() { + orgId := "orgId_example" // string | The ID of the organization + connAppId := "connAppId_example" // string | The ID of the connected app + resetSecret := true // bool | Asks service to reset secret as part of this operation (optional) + connectedAppPatchExt := *openapiclient.NewConnectedAppPatchExt() // ConnectedAppPatchExt | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ConnectedApplicationsGet(context.Background()).Execute() + resp, r, err := apiClient.DefaultApi.UpdateConnectedApp(context.Background(), orgId, connAppId).ResetSecret(resetSecret).ConnectedAppPatchExt(connectedAppPatchExt).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateConnectedApp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ConnectedApplicationsGet`: ConnectedApplicationsGet200Response - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ConnectedApplicationsGet`: %v\n", resp) + // response from `UpdateConnectedApp`: ConnectedAppRespExt + fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateConnectedApp`: %v\n", resp) } ``` ### Path Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | The ID of the organization | +**connAppId** | **string** | The ID of the connected app | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsGetRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiUpdateConnectedAppRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **resetSecret** | **bool** | Asks service to reset secret as part of this operation | + **connectedAppPatchExt** | [**ConnectedAppPatchExt**](ConnectedAppPatchExt.md) | | ### Return type -[**ConnectedApplicationsGet200Response**](ConnectedApplicationsGet200Response.md) +[**ConnectedAppRespExt**](ConnectedAppRespExt.md) ### Authorization @@ -417,7 +452,7 @@ Other parameters are passed through a pointer to a apiConnectedApplicationsGetRe ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -425,9 +460,9 @@ Other parameters are passed through a pointer to a apiConnectedApplicationsGetRe [[Back to README]](../README.md) -## ConnectedApplicationsPost +## UpdateConnectedAppScopes -> ConnectedAppRespExt ConnectedApplicationsPost(ctx).ConnectedAppCore(connectedAppCore).Execute() +> UpdateConnectedAppScopes(ctx, orgId, connAppId).ConnectedAppScopesPutBody(connectedAppScopesPutBody).Execute() @@ -446,36 +481,43 @@ import ( ) func main() { - connectedAppCore := *openapiclient.NewConnectedAppCore() // ConnectedAppCore | (optional) + orgId := "orgId_example" // string | The ID of the organization + connAppId := "connAppId_example" // string | The ID of the connected app + connectedAppScopesPutBody := *openapiclient.NewConnectedAppScopesPutBody() // ConnectedAppScopesPutBody | (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ConnectedApplicationsPost(context.Background()).ConnectedAppCore(connectedAppCore).Execute() + r, err := apiClient.DefaultApi.UpdateConnectedAppScopes(context.Background(), orgId, connAppId).ConnectedAppScopesPutBody(connectedAppScopesPutBody).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ConnectedApplicationsPost``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateConnectedAppScopes``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `ConnectedApplicationsPost`: ConnectedAppRespExt - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ConnectedApplicationsPost`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orgId** | **string** | The ID of the organization | +**connAppId** | **string** | The ID of the connected app | ### Other Parameters -Other parameters are passed through a pointer to a apiConnectedApplicationsPostRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiUpdateConnectedAppScopesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **connectedAppCore** | [**ConnectedAppCore**](ConnectedAppCore.md) | | + + + **connectedAppScopesPutBody** | [**ConnectedAppScopesPutBody**](ConnectedAppScopesPutBody.md) | | ### Return type -[**ConnectedAppRespExt**](ConnectedAppRespExt.md) + (empty response body) ### Authorization diff --git a/connected_app/docs/GetAllConnectedApps200Response.md b/connected_app/docs/GetAllConnectedApps200Response.md new file mode 100644 index 0000000..5878235 --- /dev/null +++ b/connected_app/docs/GetAllConnectedApps200Response.md @@ -0,0 +1,82 @@ +# GetAllConnectedApps200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]ConnectedAppRespExt**](ConnectedAppRespExt.md) | | [optional] +**Total** | Pointer to **int32** | | [optional] + +## Methods + +### NewGetAllConnectedApps200Response + +`func NewGetAllConnectedApps200Response() *GetAllConnectedApps200Response` + +NewGetAllConnectedApps200Response instantiates a new GetAllConnectedApps200Response 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 + +### NewGetAllConnectedApps200ResponseWithDefaults + +`func NewGetAllConnectedApps200ResponseWithDefaults() *GetAllConnectedApps200Response` + +NewGetAllConnectedApps200ResponseWithDefaults instantiates a new GetAllConnectedApps200Response 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 + +### GetData + +`func (o *GetAllConnectedApps200Response) GetData() []ConnectedAppRespExt` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *GetAllConnectedApps200Response) GetDataOk() (*[]ConnectedAppRespExt, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *GetAllConnectedApps200Response) SetData(v []ConnectedAppRespExt)` + +SetData sets Data field to given value. + +### HasData + +`func (o *GetAllConnectedApps200Response) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetTotal + +`func (o *GetAllConnectedApps200Response) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *GetAllConnectedApps200Response) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *GetAllConnectedApps200Response) SetTotal(v int32)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *GetAllConnectedApps200Response) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/connected_app/docs/GetConnectedAppScopes200Response.md b/connected_app/docs/GetConnectedAppScopes200Response.md new file mode 100644 index 0000000..7d30d98 --- /dev/null +++ b/connected_app/docs/GetConnectedAppScopes200Response.md @@ -0,0 +1,82 @@ +# GetConnectedAppScopes200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]ScopeCore**](ScopeCore.md) | | [optional] +**Total** | Pointer to **int32** | | [optional] + +## Methods + +### NewGetConnectedAppScopes200Response + +`func NewGetConnectedAppScopes200Response() *GetConnectedAppScopes200Response` + +NewGetConnectedAppScopes200Response instantiates a new GetConnectedAppScopes200Response 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 + +### NewGetConnectedAppScopes200ResponseWithDefaults + +`func NewGetConnectedAppScopes200ResponseWithDefaults() *GetConnectedAppScopes200Response` + +NewGetConnectedAppScopes200ResponseWithDefaults instantiates a new GetConnectedAppScopes200Response 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 + +### GetData + +`func (o *GetConnectedAppScopes200Response) GetData() []ScopeCore` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *GetConnectedAppScopes200Response) GetDataOk() (*[]ScopeCore, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *GetConnectedAppScopes200Response) SetData(v []ScopeCore)` + +SetData sets Data field to given value. + +### HasData + +`func (o *GetConnectedAppScopes200Response) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetTotal + +`func (o *GetConnectedAppScopes200Response) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *GetConnectedAppScopes200Response) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *GetConnectedAppScopes200Response) SetTotal(v int32)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *GetConnectedAppScopes200Response) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/connected_app/model_create_connected_app_400_response.go b/connected_app/model_create_connected_app_400_response.go new file mode 100644 index 0000000..1f1ea03 --- /dev/null +++ b/connected_app/model_create_connected_app_400_response.go @@ -0,0 +1,166 @@ +/* +Connected App API + +Description of the Connected App API + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package connected_app + +import ( + "encoding/json" +) + +// checks if the CreateConnectedApp400Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateConnectedApp400Response{} + +// CreateConnectedApp400Response struct for CreateConnectedApp400Response +type CreateConnectedApp400Response struct { + Status *int32 `json:"status,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NewCreateConnectedApp400Response instantiates a new CreateConnectedApp400Response 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 NewCreateConnectedApp400Response() *CreateConnectedApp400Response { + this := CreateConnectedApp400Response{} + var status int32 = 400 + this.Status = &status + return &this +} + +// NewCreateConnectedApp400ResponseWithDefaults instantiates a new CreateConnectedApp400Response 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 NewCreateConnectedApp400ResponseWithDefaults() *CreateConnectedApp400Response { + this := CreateConnectedApp400Response{} + var status int32 = 400 + this.Status = &status + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateConnectedApp400Response) GetStatus() int32 { + if o == nil || IsNil(o.Status) { + var ret int32 + 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 *CreateConnectedApp400Response) GetStatusOk() (*int32, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateConnectedApp400Response) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given int32 and assigns it to the Status field. +func (o *CreateConnectedApp400Response) SetStatus(v int32) { + o.Status = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *CreateConnectedApp400Response) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateConnectedApp400Response) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *CreateConnectedApp400Response) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *CreateConnectedApp400Response) SetMessage(v string) { + o.Message = &v +} + +func (o CreateConnectedApp400Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateConnectedApp400Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + return toSerialize, nil +} + +type NullableCreateConnectedApp400Response struct { + value *CreateConnectedApp400Response + isSet bool +} + +func (v NullableCreateConnectedApp400Response) Get() *CreateConnectedApp400Response { + return v.value +} + +func (v *NullableCreateConnectedApp400Response) Set(val *CreateConnectedApp400Response) { + v.value = val + v.isSet = true +} + +func (v NullableCreateConnectedApp400Response) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateConnectedApp400Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateConnectedApp400Response(val *CreateConnectedApp400Response) *NullableCreateConnectedApp400Response { + return &NullableCreateConnectedApp400Response{value: val, isSet: true} +} + +func (v NullableCreateConnectedApp400Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateConnectedApp400Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/connected_app/model_get_all_connected_apps_200_response.go b/connected_app/model_get_all_connected_apps_200_response.go new file mode 100644 index 0000000..3641ef0 --- /dev/null +++ b/connected_app/model_get_all_connected_apps_200_response.go @@ -0,0 +1,162 @@ +/* +Connected App API + +Description of the Connected App API + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package connected_app + +import ( + "encoding/json" +) + +// checks if the GetAllConnectedApps200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetAllConnectedApps200Response{} + +// GetAllConnectedApps200Response struct for GetAllConnectedApps200Response +type GetAllConnectedApps200Response struct { + Data []ConnectedAppRespExt `json:"data,omitempty"` + Total *int32 `json:"total,omitempty"` +} + +// NewGetAllConnectedApps200Response instantiates a new GetAllConnectedApps200Response 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 NewGetAllConnectedApps200Response() *GetAllConnectedApps200Response { + this := GetAllConnectedApps200Response{} + return &this +} + +// NewGetAllConnectedApps200ResponseWithDefaults instantiates a new GetAllConnectedApps200Response 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 NewGetAllConnectedApps200ResponseWithDefaults() *GetAllConnectedApps200Response { + this := GetAllConnectedApps200Response{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetAllConnectedApps200Response) GetData() []ConnectedAppRespExt { + if o == nil || IsNil(o.Data) { + var ret []ConnectedAppRespExt + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllConnectedApps200Response) GetDataOk() ([]ConnectedAppRespExt, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetAllConnectedApps200Response) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []ConnectedAppRespExt and assigns it to the Data field. +func (o *GetAllConnectedApps200Response) SetData(v []ConnectedAppRespExt) { + o.Data = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *GetAllConnectedApps200Response) GetTotal() int32 { + if o == nil || IsNil(o.Total) { + var ret int32 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAllConnectedApps200Response) GetTotalOk() (*int32, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *GetAllConnectedApps200Response) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *GetAllConnectedApps200Response) SetTotal(v int32) { + o.Total = &v +} + +func (o GetAllConnectedApps200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetAllConnectedApps200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + return toSerialize, nil +} + +type NullableGetAllConnectedApps200Response struct { + value *GetAllConnectedApps200Response + isSet bool +} + +func (v NullableGetAllConnectedApps200Response) Get() *GetAllConnectedApps200Response { + return v.value +} + +func (v *NullableGetAllConnectedApps200Response) Set(val *GetAllConnectedApps200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetAllConnectedApps200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetAllConnectedApps200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetAllConnectedApps200Response(val *GetAllConnectedApps200Response) *NullableGetAllConnectedApps200Response { + return &NullableGetAllConnectedApps200Response{value: val, isSet: true} +} + +func (v NullableGetAllConnectedApps200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetAllConnectedApps200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/connected_app/model_get_connected_app_scopes_200_response.go b/connected_app/model_get_connected_app_scopes_200_response.go new file mode 100644 index 0000000..2967606 --- /dev/null +++ b/connected_app/model_get_connected_app_scopes_200_response.go @@ -0,0 +1,162 @@ +/* +Connected App API + +Description of the Connected App API + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package connected_app + +import ( + "encoding/json" +) + +// checks if the GetConnectedAppScopes200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetConnectedAppScopes200Response{} + +// GetConnectedAppScopes200Response struct for GetConnectedAppScopes200Response +type GetConnectedAppScopes200Response struct { + Data []ScopeCore `json:"data,omitempty"` + Total *int32 `json:"total,omitempty"` +} + +// NewGetConnectedAppScopes200Response instantiates a new GetConnectedAppScopes200Response 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 NewGetConnectedAppScopes200Response() *GetConnectedAppScopes200Response { + this := GetConnectedAppScopes200Response{} + return &this +} + +// NewGetConnectedAppScopes200ResponseWithDefaults instantiates a new GetConnectedAppScopes200Response 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 NewGetConnectedAppScopes200ResponseWithDefaults() *GetConnectedAppScopes200Response { + this := GetConnectedAppScopes200Response{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetConnectedAppScopes200Response) GetData() []ScopeCore { + if o == nil || IsNil(o.Data) { + var ret []ScopeCore + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetConnectedAppScopes200Response) GetDataOk() ([]ScopeCore, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetConnectedAppScopes200Response) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []ScopeCore and assigns it to the Data field. +func (o *GetConnectedAppScopes200Response) SetData(v []ScopeCore) { + o.Data = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *GetConnectedAppScopes200Response) GetTotal() int32 { + if o == nil || IsNil(o.Total) { + var ret int32 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetConnectedAppScopes200Response) GetTotalOk() (*int32, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *GetConnectedAppScopes200Response) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *GetConnectedAppScopes200Response) SetTotal(v int32) { + o.Total = &v +} + +func (o GetConnectedAppScopes200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetConnectedAppScopes200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + return toSerialize, nil +} + +type NullableGetConnectedAppScopes200Response struct { + value *GetConnectedAppScopes200Response + isSet bool +} + +func (v NullableGetConnectedAppScopes200Response) Get() *GetConnectedAppScopes200Response { + return v.value +} + +func (v *NullableGetConnectedAppScopes200Response) Set(val *GetConnectedAppScopes200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetConnectedAppScopes200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetConnectedAppScopes200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetConnectedAppScopes200Response(val *GetConnectedAppScopes200Response) *NullableGetConnectedAppScopes200Response { + return &NullableGetConnectedAppScopes200Response{value: val, isSet: true} +} + +func (v NullableGetConnectedAppScopes200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetConnectedAppScopes200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +