Skip to content

Commit

Permalink
Deploying from phrase/openapi@f670e276
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Jan 29, 2025
1 parent c1dc491 commit 9169770
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
47 changes: 24 additions & 23 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -8949,9 +8934,8 @@ paths:
--project_id <project_id> \
--id <id> \
--branch my-feature-branch \
--translation_key_ids "abcd1234cdef1234abcd1234cdef1234" \
--data '{"branch": "my-feature-branch", "translation_key_ids": ["abcd1234cdef1234abcd1234cdef1234"]}' \
--access_token <token>
x-cli-version: "2.5"
post:
description: Add multiple keys to a existing job.
operationId: job/keys/create
Expand Down Expand Up @@ -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:
Expand Down
28 changes: 6 additions & 22 deletions api_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"reflect"
"strings"

"github.com/antihax/optional"
Expand Down Expand Up @@ -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"`
}

/*
Expand All @@ -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{}
Expand All @@ -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)
Expand All @@ -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 {
Expand Down
12 changes: 12 additions & 0 deletions docs/JobKeysDeleteParameters.md
Original file line number Diff line number Diff line change
@@ -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)


8 changes: 4 additions & 4 deletions docs/JobsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Name | Type | Description | Notes

## JobKeysDelete

> JobKeysDelete(ctx, projectId, id, optional)
> JobKeysDelete(ctx, projectId, id, jobKeysDeleteParameters, optional)
Remove keys from job

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions model_job_keys_delete_parameters.go
Original file line number Diff line number Diff line change
@@ -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"`
}

0 comments on commit 9169770

Please sign in to comment.