Skip to content

Commit

Permalink
Deploying from phrase/openapi@033be100
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Dec 20, 2024
1 parent 83a90ce commit a5512b3
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 326 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ api_projects.go
api_quality_performance_score.go
api_release_triggers.go
api_releases.go
api_repo_sync_events.go
api_repo_syncs.go
api_reports.go
api_screenshot_markers.go
Expand Down Expand Up @@ -243,6 +244,7 @@ docs/RepliesListParameters.md
docs/RepoSync.md
docs/RepoSyncEvent.md
docs/RepoSyncEventErrorsInner.md
docs/RepoSyncEventsApi.md
docs/RepoSyncsApi.md
docs/ReportsApi.md
docs/Screenshot.md
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ Class | Method | HTTP request | Description
*ReleasesApi* | [**ReleaseShow**](docs/ReleasesApi.md#releaseshow) | **Get** /accounts/{account_id}/distributions/{distribution_id}/releases/{id} | Get a single release
*ReleasesApi* | [**ReleaseUpdate**](docs/ReleasesApi.md#releaseupdate) | **Patch** /accounts/{account_id}/distributions/{distribution_id}/releases/{id} | Update a release
*ReleasesApi* | [**ReleasesList**](docs/ReleasesApi.md#releaseslist) | **Get** /accounts/{account_id}/distributions/{distribution_id}/releases | List releases
*RepoSyncEventsApi* | [**RepoSyncEventList**](docs/RepoSyncEventsApi.md#reposynceventlist) | **Get** /accounts/{account_id}/repo_syncs/{id}/events | Repository Syncs History
*RepoSyncEventsApi* | [**RepoSyncEventShow**](docs/RepoSyncEventsApi.md#reposynceventshow) | **Get** /accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id} | Get a single Repo Sync Event
*RepoSyncsApi* | [**RepoSyncActivate**](docs/RepoSyncsApi.md#reposyncactivate) | **Post** /accounts/{account_id}/repo_syncs/{id}/activate | Activate a Repo Sync
*RepoSyncsApi* | [**RepoSyncDeactivate**](docs/RepoSyncsApi.md#reposyncdeactivate) | **Post** /accounts/{account_id}/repo_syncs/{id}/deactivate | Deactivate a Repo Sync
*RepoSyncsApi* | [**RepoSyncEventShow**](docs/RepoSyncsApi.md#reposynceventshow) | **Get** /accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id} | Get a single Repo Sync Event
*RepoSyncsApi* | [**RepoSyncEvents**](docs/RepoSyncsApi.md#reposyncevents) | **Get** /accounts/{account_id}/repo_syncs/{id}/events | Repository Syncs History
*RepoSyncsApi* | [**RepoSyncExport**](docs/RepoSyncsApi.md#reposyncexport) | **Post** /accounts/{account_id}/repo_syncs/{id}/export | Export to code repository
*RepoSyncsApi* | [**RepoSyncImport**](docs/RepoSyncsApi.md#reposyncimport) | **Post** /accounts/{account_id}/repo_syncs/{id}/import | Import from code repository
*RepoSyncsApi* | [**RepoSyncList**](docs/RepoSyncsApi.md#reposynclist) | **Get** /accounts/{account_id}/repo_syncs | Get Repo Syncs
Expand Down Expand Up @@ -616,6 +616,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected]


## Get help / support
Expand Down
26 changes: 13 additions & 13 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21186,7 +21186,7 @@ paths:
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase repo_sync list \
phrase repo_syncs list \
--account_id abcd1234 \
--access_token <token>
x-cli-version: "2.24"
Expand Down Expand Up @@ -21270,7 +21270,7 @@ paths:
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase repo_sync show \
phrase repo_syncs show \
--id <id> \
--account_id abcd1234 \
--access_token <token>
Expand Down Expand Up @@ -21361,7 +21361,7 @@ paths:
-H 'Content-Type: application/json'
- lang: CLI v2
source: |-
phrase repo_sync export \
phrase repo_syncs export \
--id <repo_sync_id> \
--access_token <token>
x-cli-version: "2.24"
Expand Down Expand Up @@ -21451,7 +21451,7 @@ paths:
-H 'Content-Type: application/json'
- lang: CLI v2
source: |-
phrase repo_sync import \
phrase repo_syncs import \
--id <repo_sync_id> \
--access_token <token>
x-cli-version: "2.24"
Expand All @@ -21460,7 +21460,7 @@ paths:
description: |-
Get the history of a single Repo Sync. The history includes all imports and exports
performed by the Repo Sync.
operationId: repo_sync/events
operationId: repo_sync_event/list
parameters:
- description: Two-Factor-Authentication token (optional)
explode: false
Expand Down Expand Up @@ -21535,15 +21535,15 @@ paths:
$ref: '#/components/headers/X-Rate-Limit-Reset'
summary: Repository Syncs History
tags:
- Repo Syncs
- Repo Sync Events
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/56ef78/events"\
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase repo_sync events \
phrase repo_sync_events list \
--id <id> \
--account_id abcd1234 \
--access_token <token>
Expand Down Expand Up @@ -21628,15 +21628,15 @@ paths:
$ref: '#/components/headers/X-Rate-Limit-Reset'
summary: Get a single Repo Sync Event
tags:
- Repo Syncs
- Repo Sync Events
x-code-samples:
- lang: Curl
source: |-
curl "https://api.phrase.com/v2/accounts/ab12cd34/repo_syncs/56ef78/events/78dfgj"\
-u USERNAME_OR_ACCESS_TOKEN
- lang: CLI v2
source: |-
phrase repo_sync_event show \
phrase repo_sync_events show \
--id <id> \
--repo_sync_id <repo_sync_id> \
--account_id abcd1234 \
Expand Down Expand Up @@ -21726,7 +21726,7 @@ paths:
-H 'Content-Type: application/json'
- lang: CLI v2
source: |-
phrase repo_sync deactivate \
phrase repo_syncs deactivate \
--id <repo_sync_id> \
--access_token <token>
x-cli-version: "2.24"
Expand Down Expand Up @@ -21814,7 +21814,7 @@ paths:
-H 'Content-Type: application/json'
- lang: CLI v2
source: |-
phrase repo_sync activate \
phrase repo_syncs activate \
--id <repo_sync_id> \
--access_token <token>
x-cli-version: "2.24"
Expand Down Expand Up @@ -31105,7 +31105,7 @@ components:
type: object
repo_sync_event:
example:
event_type: import
type: import
created_at: 2015-01-28T09:52:53Z
status: failure
auto_import: true
Expand All @@ -31115,7 +31115,7 @@ components:
properties:
id:
type: string
event_type:
type:
enum:
- import
- export
Expand Down
230 changes: 230 additions & 0 deletions api_repo_sync_events.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
package phrase

import (
_context "context"
_ioutil "io/ioutil"
_nethttp "net/http"
_neturl "net/url"
"strings"

"github.com/antihax/optional"
)

// Linger please
var (
_ _context.Context
)

// RepoSyncEventsApiService RepoSyncEventsApi service
type RepoSyncEventsApiService service

// RepoSyncEventListOpts Optional parameters for the method 'RepoSyncEventList'
type RepoSyncEventListOpts struct {
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
}

/*
RepoSyncEventList Repository Syncs History
Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param accountId Account ID
- @param id ID
- @param optional nil or *RepoSyncEventListOpts - Optional Parameters:
- @param "XPhraseAppOTP" (optional.String) - Two-Factor-Authentication token (optional)
@return []RepoSyncEvent
*/
func (a *RepoSyncEventsApiService) RepoSyncEventList(ctx _context.Context, accountId string, id string, localVarOptionals *RepoSyncEventListOpts) ([]RepoSyncEvent, *APIResponse, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []RepoSyncEvent
)

// create path and map variables
localVarPath := a.client.cfg.BasePath + "/accounts/{account_id}/repo_syncs/{id}/events"
localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.QueryEscape(parameterToString(accountId, "")), -1)

localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}

// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}

// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}

// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XPhraseAppOTP.IsSet() {
localVarHeaderParams["X-PhraseApp-OTP"] = parameterToString(localVarOptionals.XPhraseAppOTP.Value(), "")
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// RepoSyncEventShowOpts Optional parameters for the method 'RepoSyncEventShow'
type RepoSyncEventShowOpts struct {
XPhraseAppOTP optional.String `json:"X-PhraseApp-OTP,omitempty"`
}

/*
RepoSyncEventShow Get a single Repo Sync Event
Shows a single Repo Sync event.
- @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param accountId Account ID
- @param repoSyncId Repo Sync ID
- @param id ID
- @param optional nil or *RepoSyncEventShowOpts - Optional Parameters:
- @param "XPhraseAppOTP" (optional.String) - Two-Factor-Authentication token (optional)
@return RepoSyncEvent
*/
func (a *RepoSyncEventsApiService) RepoSyncEventShow(ctx _context.Context, accountId string, repoSyncId string, id string, localVarOptionals *RepoSyncEventShowOpts) (RepoSyncEvent, *APIResponse, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue RepoSyncEvent
)

// create path and map variables
localVarPath := a.client.cfg.BasePath + "/accounts/{account_id}/repo_syncs/{repo_sync_id}/events/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", _neturl.QueryEscape(parameterToString(accountId, "")), -1)

localVarPath = strings.Replace(localVarPath, "{"+"repo_sync_id"+"}", _neturl.QueryEscape(parameterToString(repoSyncId, "")), -1)

localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}

// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}

// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}

// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XPhraseAppOTP.IsSet() {
localVarHeaderParams["X-PhraseApp-OTP"] = parameterToString(localVarOptionals.XPhraseAppOTP.Value(), "")
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["Authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.client.callAPI(r)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}
Loading

0 comments on commit a5512b3

Please sign in to comment.