-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying from phrase/openapi@033be100
- Loading branch information
Phrase
committed
Dec 20, 2024
1 parent
83a90ce
commit a5512b3
Showing
10 changed files
with
359 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -616,6 +616,7 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
||
|
||
## Get help / support | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.