Skip to content

Commit

Permalink
Deploying from phrase/openapi@e201d136
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Nov 20, 2024
1 parent 7b135ef commit d2d8080
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 83 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ docs/BranchUpdateParameters.md
docs/BranchesApi.md
docs/Comment.md
docs/CommentCreateParameters.md
docs/CommentCreateParameters1.md
docs/CommentMarkReadParameters.md
docs/CommentReaction.md
docs/CommentReactionsApi.md
Expand Down Expand Up @@ -364,6 +365,7 @@ model_branch_name.go
model_branch_update_parameters.go
model_comment.go
model_comment_create_parameters.go
model_comment_create_parameters_1.go
model_comment_mark_read_parameters.go
model_comment_reaction.go
model_comment_update_parameters.go
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ Class | Method | HTTP request | Description
- [BranchUpdateParameters](docs/BranchUpdateParameters.md)
- [Comment](docs/Comment.md)
- [CommentCreateParameters](docs/CommentCreateParameters.md)
- [CommentCreateParameters1](docs/CommentCreateParameters1.md)
- [CommentMarkReadParameters](docs/CommentMarkReadParameters.md)
- [CommentReaction](docs/CommentReaction.md)
- [CommentUpdateParameters](docs/CommentUpdateParameters.md)
Expand Down
78 changes: 35 additions & 43 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10839,26 +10839,6 @@ paths:
schema:
type: string
style: simple
- description: specify the message for the comment
example: some message...
explode: true
in: query
name: message
required: false
schema:
type: string
style: form
- description: specify the locales for the comment
example: someId
explode: true
in: query
name: locale_ids
required: false
schema:
items:
type: string
type: array
style: form
requestBody:
content:
application/json:
Expand Down Expand Up @@ -12266,24 +12246,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: specify the message for the comment
example: some message...
explode: true
in: query
name: message
required: false
schema:
type: string
style: form
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/comment_create_parameters_1'
required: true
responses:
"201":
content:
Expand Down Expand Up @@ -12340,7 +12308,7 @@ paths:
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies/" \
curl "https://api.phrase.com/v2/projects/:project_id/keys/:key_id/comments/:comment_id/replies" \
-u USERNAME_OR_ACCESS_TOKEN \
-X POST \
-d '{"branch":"my-feature-branch", "message":"Some message..."}' \
Expand Down Expand Up @@ -33670,14 +33638,24 @@ components:
type: object
comment_create_parameters:
properties:
branch:
description: specify the branch to use
example: my-feature-branch
type: string
message:
description: Comment message
example: Some message...
type: string
branch:
description: specify the branch to use
example: my-feature-branch
type: string
locale_ids:
description: specify the locales for the comment
example:
- someId
- someOtherId
items:
type: string
type: array
required:
- message
title: comment/create/parameters
type: object
comment_update_parameters:
Expand Down Expand Up @@ -33724,6 +33702,20 @@ components:
type: string
title: replies/list/parameters
type: object
comment_create_parameters_1:
properties:
message:
description: Reply message body
example: Some message...
type: string
branch:
description: Specify the branch to use
example: my-feature-branch
type: string
required:
- message
title: comment/create/parameters
type: object
webhook_create_parameters:
properties:
callback_url:
Expand Down
17 changes: 5 additions & 12 deletions api_comment_replies.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ func (a *CommentRepliesApiService) RepliesList(ctx _context.Context, projectId s
// ReplyCreateOpts Optional parameters for the method 'ReplyCreate'
type ReplyCreateOpts struct {
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
Branch optional.String `json:"branch,omitempty"`
Message optional.String `json:"message,omitempty"`
}

/*
Expand All @@ -181,14 +179,13 @@ Create a new reply for a comment.
- @param projectId Project ID
- @param keyId Translation Key ID
- @param commentId Comment ID
- @param commentCreateParameters1
- @param optional nil or *ReplyCreateOpts - Optional Parameters:
- @param "XPhraseAppOTP" (optional.String) - Two-Factor-Authentication token (optional)
- @param "Branch" (optional.String) - specify the branch to use
- @param "Message" (optional.String) - specify the message for the comment
@return Comment
*/
func (a *CommentRepliesApiService) ReplyCreate(ctx _context.Context, projectId string, keyId string, commentId string, localVarOptionals *ReplyCreateOpts) (Comment, *APIResponse, error) {
func (a *CommentRepliesApiService) ReplyCreate(ctx _context.Context, projectId string, keyId string, commentId string, commentCreateParameters1 CommentCreateParameters1, localVarOptionals *ReplyCreateOpts) (Comment, *APIResponse, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
Expand All @@ -210,14 +207,8 @@ func (a *CommentRepliesApiService) ReplyCreate(ctx _context.Context, projectId s
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}

if localVarOptionals != nil && localVarOptionals.Branch.IsSet() {
localVarQueryParams.Add("branch", parameterToString(localVarOptionals.Branch.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Message.IsSet() {
localVarQueryParams.Add("message", parameterToString(localVarOptionals.Message.Value(), ""))
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
localVarHTTPContentTypes := []string{"application/json"}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
Expand All @@ -236,6 +227,8 @@ func (a *CommentRepliesApiService) ReplyCreate(ctx _context.Context, projectId s
if localVarOptionals != nil && localVarOptionals.XPhraseAppOTP.IsSet() {
localVarHeaderParams["X-PhraseApp-OTP"] = parameterToString(localVarOptionals.XPhraseAppOTP.Value(), "")
}
// body params
localVarPostBody = &commentCreateParameters1
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
Expand Down
20 changes: 1 addition & 19 deletions api_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ type CommentsApiService service

// CommentCreateOpts Optional parameters for the method 'CommentCreate'
type CommentCreateOpts struct {
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
Message optional.String `json:"message,omitempty"`
LocaleIds optional.Interface `json:"locale_ids,omitempty"`
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
}

/*
Expand All @@ -35,8 +33,6 @@ Create a new comment for a key.
- @param commentCreateParameters
- @param optional nil or *CommentCreateOpts - Optional Parameters:
- @param "XPhraseAppOTP" (optional.String) - Two-Factor-Authentication token (optional)
- @param "Message" (optional.String) - specify the message for the comment
- @param "LocaleIds" (optional.Interface of []string) - specify the locales for the comment
@return Comment
*/
Expand All @@ -60,20 +56,6 @@ func (a *CommentsApiService) CommentCreate(ctx _context.Context, projectId strin
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}

if localVarOptionals != nil && localVarOptionals.Message.IsSet() {
localVarQueryParams.Add("message", parameterToString(localVarOptionals.Message.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.LocaleIds.IsSet() {
t := localVarOptionals.LocaleIds.Value()
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("locale_ids", parameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("locale_ids", parameterToString(t, "multi"))
}
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}

Expand Down
3 changes: 2 additions & 1 deletion docs/CommentCreateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Message** | **string** | Comment message |
**Branch** | **string** | specify the branch to use | [optional]
**Message** | **string** | Comment message | [optional]
**LocaleIds** | **[]string** | specify the locales for the comment | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
12 changes: 12 additions & 0 deletions docs/CommentCreateParameters1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CommentCreateParameters1

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Message** | **string** | Reply message body |
**Branch** | **string** | Specify the branch to use | [optional]

[[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/CommentRepliesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Name | Type | Description | Notes

## ReplyCreate

> Comment ReplyCreate(ctx, projectId, keyId, commentId, optional)
> Comment ReplyCreate(ctx, projectId, keyId, commentId, commentCreateParameters1, optional)
Create a reply

Expand All @@ -87,6 +87,7 @@ Name | Type | Description | Notes
**projectId** | **string**| Project ID |
**keyId** | **string**| Translation Key ID |
**commentId** | **string**| Comment ID |
**commentCreateParameters1** | [**CommentCreateParameters1**](CommentCreateParameters1.md)| |
**optional** | ***ReplyCreateOpts** | optional parameters | nil if no parameters

### Optional Parameters
Expand All @@ -99,9 +100,8 @@ Name | Type | Description | Notes




**xPhraseAppOTP** | **optional.String**| Two-Factor-Authentication token (optional) |
**branch** | **optional.String**| specify the branch to use |
**message** | **optional.String**| specify the message for the comment |

### Return type

Expand All @@ -113,7 +113,7 @@ Name | Type | Description | Notes

### 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)
Expand Down
2 changes: 0 additions & 2 deletions docs/CommentsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ Name | Type | Description | Notes


**xPhraseAppOTP** | **optional.String**| Two-Factor-Authentication token (optional) |
**message** | **optional.String**| specify the message for the comment |
**localeIds** | [**optional.Interface of []string**](string.md)| specify the locales for the comment |

### Return type

Expand Down
6 changes: 4 additions & 2 deletions model_comment_create_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package phrase

// CommentCreateParameters struct for CommentCreateParameters
type CommentCreateParameters struct {
// Comment message
Message string `json:"message"`
// specify the branch to use
Branch string `json:"branch,omitempty"`
// Comment message
Message string `json:"message,omitempty"`
// specify the locales for the comment
LocaleIds []string `json:"locale_ids,omitempty"`
}
9 changes: 9 additions & 0 deletions model_comment_create_parameters_1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package phrase

// CommentCreateParameters1 struct for CommentCreateParameters1
type CommentCreateParameters1 struct {
// Reply message body
Message string `json:"message"`
// Specify the branch to use
Branch string `json:"branch,omitempty"`
}

0 comments on commit d2d8080

Please sign in to comment.