From 9169770649d94e79f1d12768ee8016e24cdeb0cf Mon Sep 17 00:00:00 2001 From: Phrase Date: Wed, 29 Jan 2025 15:15:59 +0000 Subject: [PATCH] Deploying from phrase/openapi@f670e276 --- .openapi-generator/FILES | 2 ++ README.md | 1 + api/openapi.yaml | 47 +++++++++++++++-------------- api_jobs.go | 28 ++++------------- docs/JobKeysDeleteParameters.md | 12 ++++++++ docs/JobsApi.md | 8 ++--- model_job_keys_delete_parameters.go | 9 ++++++ 7 files changed, 58 insertions(+), 49 deletions(-) create mode 100644 docs/JobKeysDeleteParameters.md create mode 100644 model_job_keys_delete_parameters.go diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 6ef29de..f46a3e0 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -139,6 +139,7 @@ docs/JobCompleteParameters.md docs/JobCreateParameters.md docs/JobDetails.md docs/JobKeysCreateParameters.md +docs/JobKeysDeleteParameters.md docs/JobLocale.md docs/JobLocaleCompleteParameters.md docs/JobLocaleCompleteReviewParameters.md @@ -390,6 +391,7 @@ model_job_complete_parameters.go model_job_create_parameters.go model_job_details.go model_job_keys_create_parameters.go +model_job_keys_delete_parameters.go model_job_locale.go model_job_locale_complete_parameters.go model_job_locale_complete_review_parameters.go diff --git a/README.md b/README.md index 1dbb675..0aa6834 100644 --- a/README.md +++ b/README.md @@ -404,6 +404,7 @@ Class | Method | HTTP request | Description - [JobCreateParameters](docs/JobCreateParameters.md) - [JobDetails](docs/JobDetails.md) - [JobKeysCreateParameters](docs/JobKeysCreateParameters.md) + - [JobKeysDeleteParameters](docs/JobKeysDeleteParameters.md) - [JobLocale](docs/JobLocale.md) - [JobLocaleCompleteParameters](docs/JobLocaleCompleteParameters.md) - [JobLocaleCompleteReviewParameters](docs/JobLocaleCompleteReviewParameters.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index cd84af6..55f41fb 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -8874,27 +8874,12 @@ paths: schema: type: string style: simple - - description: specify the branch to use - example: my-feature-branch - explode: true - in: query - name: branch - required: false - schema: - type: string - style: form - - description: ids of keys that should be removed from the job - example: - - abcd1234cdef1234abcd1234cdef1234 - explode: true - in: query - name: translation_key_ids - required: false - schema: - items: - type: string - type: array - style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/job_keys_delete_parameters' + required: true responses: "204": description: The resource was deleted successfully. @@ -8949,9 +8934,8 @@ paths: --project_id \ --id \ --branch my-feature-branch \ - --translation_key_ids "abcd1234cdef1234abcd1234cdef1234" \ + --data '{"branch": "my-feature-branch", "translation_key_ids": ["abcd1234cdef1234abcd1234cdef1234"]}' \ --access_token - x-cli-version: "2.5" post: description: Add multiple keys to a existing job. operationId: job/keys/create @@ -32236,6 +32220,23 @@ components: type: array title: job/keys/create/parameters type: object + job_keys_delete_parameters: + properties: + branch: + description: specify the branch to use + example: my-feature-branch + type: string + translation_key_ids: + description: ids of keys that should be deleted from the job + example: + - abcd1234cdef1234abcd1234cdef1234 + items: + type: string + type: array + required: + - translation_key_ids + title: job/keys/delete/parameters + type: object job_template_create_parameters: properties: branch: diff --git a/api_jobs.go b/api_jobs.go index 28f4fee..987a6a1 100644 --- a/api_jobs.go +++ b/api_jobs.go @@ -5,7 +5,6 @@ import ( _ioutil "io/ioutil" _nethttp "net/http" _neturl "net/url" - "reflect" "strings" "github.com/antihax/optional" @@ -436,9 +435,7 @@ func (a *JobsApiService) JobKeysCreate(ctx _context.Context, projectId string, i // JobKeysDeleteOpts Optional parameters for the method 'JobKeysDelete' type JobKeysDeleteOpts struct { - XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"` - Branch optional.String `json:"branch,omitempty"` - TranslationKeyIds optional.Interface `json:"translation_key_ids,omitempty"` + XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"` } /* @@ -447,12 +444,11 @@ Remove multiple keys from existing job. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId Project ID - @param id ID + - @param jobKeysDeleteParameters - @param optional nil or *JobKeysDeleteOpts - Optional Parameters: - @param "XPhraseAppOTP" (optional.String) - Two-Factor-Authentication token (optional) - - @param "Branch" (optional.String) - specify the branch to use - - @param "TranslationKeyIds" (optional.Interface of []string) - ids of keys that should be removed from the job */ -func (a *JobsApiService) JobKeysDelete(ctx _context.Context, projectId string, id string, localVarOptionals *JobKeysDeleteOpts) ([]byte, *APIResponse, error) { +func (a *JobsApiService) JobKeysDelete(ctx _context.Context, projectId string, id string, jobKeysDeleteParameters JobKeysDeleteParameters, localVarOptionals *JobKeysDeleteOpts) ([]byte, *APIResponse, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -471,22 +467,8 @@ func (a *JobsApiService) JobKeysDelete(ctx _context.Context, projectId string, i localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - if localVarOptionals != nil && localVarOptionals.Branch.IsSet() { - localVarQueryParams.Add("branch", parameterToString(localVarOptionals.Branch.Value(), "")) - } - if localVarOptionals != nil && localVarOptionals.TranslationKeyIds.IsSet() { - t := localVarOptionals.TranslationKeyIds.Value() - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("translation_key_ids", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("translation_key_ids", parameterToString(t, "multi")) - } - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -505,6 +487,8 @@ func (a *JobsApiService) JobKeysDelete(ctx _context.Context, projectId string, i if localVarOptionals != nil && localVarOptionals.XPhraseAppOTP.IsSet() { localVarHeaderParams["X-PhraseApp-OTP"] = parameterToString(localVarOptionals.XPhraseAppOTP.Value(), "") } + // body params + localVarPostBody = &jobKeysDeleteParameters if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { diff --git a/docs/JobKeysDeleteParameters.md b/docs/JobKeysDeleteParameters.md new file mode 100644 index 0000000..dffca5c --- /dev/null +++ b/docs/JobKeysDeleteParameters.md @@ -0,0 +1,12 @@ +# JobKeysDeleteParameters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Branch** | **string** | specify the branch to use | [optional] +**TranslationKeyIds** | **[]string** | ids of keys that should be deleted from the job | + +[[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/docs/JobsApi.md b/docs/JobsApi.md index d18dc7f..344b408 100644 --- a/docs/JobsApi.md +++ b/docs/JobsApi.md @@ -215,7 +215,7 @@ Name | Type | Description | Notes ## JobKeysDelete -> JobKeysDelete(ctx, projectId, id, optional) +> JobKeysDelete(ctx, projectId, id, jobKeysDeleteParameters, optional) Remove keys from job @@ -229,6 +229,7 @@ Name | Type | Description | Notes **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **projectId** | **string**| Project ID | **id** | **string**| ID | +**jobKeysDeleteParameters** | [**JobKeysDeleteParameters**](JobKeysDeleteParameters.md)| | **optional** | ***JobKeysDeleteOpts** | optional parameters | nil if no parameters ### Optional Parameters @@ -240,9 +241,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **xPhraseAppOTP** | **optional.String**| Two-Factor-Authentication token (optional) | - **branch** | **optional.String**| specify the branch to use | - **translationKeyIds** | [**optional.Interface of []string**](string.md)| ids of keys that should be removed from the job | ### Return type @@ -254,7 +254,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/model_job_keys_delete_parameters.go b/model_job_keys_delete_parameters.go new file mode 100644 index 0000000..4aa4fe5 --- /dev/null +++ b/model_job_keys_delete_parameters.go @@ -0,0 +1,9 @@ +package phrase + +// JobKeysDeleteParameters struct for JobKeysDeleteParameters +type JobKeysDeleteParameters struct { + // specify the branch to use + Branch string `json:"branch,omitempty"` + // ids of keys that should be deleted from the job + TranslationKeyIds []string `json:"translation_key_ids"` +}