Merged in feature/batch-status (pull request #215)
Implement and test the batch status feature * working
This commit is contained in:
+901
-1
@@ -30,6 +30,23 @@ const (
|
||||
Enable AdminUserActionResponseAction = "enable"
|
||||
)
|
||||
|
||||
// Defines values for BatchDocumentOutcomeOutcome.
|
||||
const (
|
||||
CleanFailed BatchDocumentOutcomeOutcome = "clean_failed"
|
||||
CleanPassed BatchDocumentOutcomeOutcome = "clean_passed"
|
||||
Duplicate BatchDocumentOutcomeOutcome = "duplicate"
|
||||
FailedOpen BatchDocumentOutcomeOutcome = "failed_open"
|
||||
FailedRead BatchDocumentOutcomeOutcome = "failed_read"
|
||||
FailedS3Upload BatchDocumentOutcomeOutcome = "failed_s3_upload"
|
||||
FailedUpload BatchDocumentOutcomeOutcome = "failed_upload"
|
||||
InitComplete BatchDocumentOutcomeOutcome = "init_complete"
|
||||
InitDuplicate BatchDocumentOutcomeOutcome = "init_duplicate"
|
||||
InvalidType BatchDocumentOutcomeOutcome = "invalid_type"
|
||||
Submitted BatchDocumentOutcomeOutcome = "submitted"
|
||||
SyncComplete BatchDocumentOutcomeOutcome = "sync_complete"
|
||||
SyncSkipped BatchDocumentOutcomeOutcome = "sync_skipped"
|
||||
)
|
||||
|
||||
// Defines values for BatchStatus.
|
||||
const (
|
||||
BatchStatusCancelled BatchStatus = "cancelled"
|
||||
@@ -194,7 +211,7 @@ type AdminUserDetails struct {
|
||||
// LastName User's family name retrieved from Cognito
|
||||
LastName *string `json:"last_name,omitempty"`
|
||||
|
||||
// Roles Roles assigned in Permit.io
|
||||
// Roles Roles assigned in Permit.io. Only populated by GET /admin/users/{email}. Not populated by GET /admin/users (list endpoint) for performance reasons.
|
||||
Roles *[]string `json:"roles,omitempty"`
|
||||
|
||||
// Status Current Cognito user account status
|
||||
@@ -350,6 +367,33 @@ type ArrayFieldItem struct {
|
||||
UnitOfMeasure *string `json:"unitOfMeasure,omitempty"`
|
||||
}
|
||||
|
||||
// BatchDocumentOutcome Per-file outcome from batch extraction and pipeline processing
|
||||
type BatchDocumentOutcome struct {
|
||||
// CleanFailReason Specific clean validation failure reason when outcome is clean_failed. Null otherwise.
|
||||
CleanFailReason nullable.Nullable[string] `json:"clean_fail_reason,omitempty"`
|
||||
|
||||
// CreatedAt When the file was first extracted from the ZIP
|
||||
CreatedAt *time.Time `json:"created_at,omitempty"`
|
||||
|
||||
// DocumentId Assigned document ID (null for files that never became documents)
|
||||
DocumentId nullable.Nullable[openapi_types.UUID] `json:"document_id,omitempty"`
|
||||
|
||||
// ErrorDetail Human-readable error message for failure outcomes
|
||||
ErrorDetail nullable.Nullable[string] `json:"error_detail,omitempty"`
|
||||
|
||||
// Filename Original filename from the ZIP archive
|
||||
Filename string `json:"filename"`
|
||||
|
||||
// Outcome Current processing status
|
||||
Outcome BatchDocumentOutcomeOutcome `json:"outcome"`
|
||||
|
||||
// UpdatedAt When the outcome was last updated by a pipeline stage
|
||||
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
||||
}
|
||||
|
||||
// BatchDocumentOutcomeOutcome Current processing status
|
||||
type BatchDocumentOutcomeOutcome string
|
||||
|
||||
// BatchID The batch upload id.
|
||||
type BatchID = openapi_types.UUID
|
||||
|
||||
@@ -370,6 +414,9 @@ type BatchUploadDetails struct {
|
||||
// CreatedAt When the batch upload was created
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
|
||||
// DocumentOutcomes Per-file outcome tracking for all files in the batch
|
||||
DocumentOutcomes *[]BatchDocumentOutcome `json:"document_outcomes,omitempty"`
|
||||
|
||||
// FailedDocuments Number of documents that failed processing
|
||||
FailedDocuments int32 `json:"failed_documents"`
|
||||
|
||||
@@ -1195,12 +1242,50 @@ type SingleFields struct {
|
||||
ProviderState *string `json:"providerState,omitempty"`
|
||||
}
|
||||
|
||||
// UISetting A UI setting record
|
||||
type UISetting struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Id openapi_types.UUID `json:"id"`
|
||||
IsDeleted bool `json:"isDeleted"`
|
||||
Key string `json:"key"`
|
||||
Namespace string `json:"namespace"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
Value map[string]interface{} `json:"value"`
|
||||
}
|
||||
|
||||
// UISettingCreate Request body for creating a UI setting
|
||||
type UISettingCreate struct {
|
||||
// Key Setting key within the namespace
|
||||
Key string `json:"key"`
|
||||
|
||||
// Namespace Scope for the setting (e.g. demo-dashboard:{userId}, feature-flags:global, saved-filters:{clientId})
|
||||
Namespace string `json:"namespace"`
|
||||
|
||||
// Value JSON value (object) for the setting
|
||||
Value map[string]interface{} `json:"value"`
|
||||
}
|
||||
|
||||
// UISettingListResponse List of UI settings
|
||||
type UISettingListResponse struct {
|
||||
Settings []UISetting `json:"settings"`
|
||||
TotalCount int32 `json:"totalCount"`
|
||||
}
|
||||
|
||||
// UISettingUpdate Request body for updating a UI setting
|
||||
type UISettingUpdate struct {
|
||||
// Value New JSON value for the setting
|
||||
Value map[string]interface{} `json:"value"`
|
||||
}
|
||||
|
||||
// Version The desired version.
|
||||
type Version = int32
|
||||
|
||||
// EulaVersionID defines model for EulaVersionID.
|
||||
type EulaVersionID = openapi_types.UUID
|
||||
|
||||
// UISettingID defines model for UISettingID.
|
||||
type UISettingID = openapi_types.UUID
|
||||
|
||||
// UserEmail defines model for UserEmail.
|
||||
type UserEmail = openapi_types.Email
|
||||
|
||||
@@ -1406,6 +1491,12 @@ type LoginCallbackParams struct {
|
||||
State string `form:"state" json:"state"`
|
||||
}
|
||||
|
||||
// ListUISettingsParams defines parameters for ListUISettings.
|
||||
type ListUISettingsParams struct {
|
||||
// Namespace Filter by namespace (omit to list all).
|
||||
Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
// CreateEulaVersionJSONRequestBody defines body for CreateEulaVersion for application/json ContentType.
|
||||
type CreateEulaVersionJSONRequestBody = EulaVersionCreate
|
||||
|
||||
@@ -1448,6 +1539,12 @@ type CreateFolderJSONRequestBody = FolderCreate
|
||||
// RenameFolderJSONRequestBody defines body for RenameFolder for application/json ContentType.
|
||||
type RenameFolderJSONRequestBody = FolderRename
|
||||
|
||||
// CreateUISettingJSONRequestBody defines body for CreateUISetting for application/json ContentType.
|
||||
type CreateUISettingJSONRequestBody = UISettingCreate
|
||||
|
||||
// UpdateUISettingJSONRequestBody defines body for UpdateUISetting for application/json ContentType.
|
||||
type UpdateUISettingJSONRequestBody = UISettingUpdate
|
||||
|
||||
// RequestEditorFn is the function signature for the RequestEditor callback function
|
||||
type RequestEditorFn func(ctx context.Context, req *http.Request) error
|
||||
|
||||
@@ -1703,6 +1800,25 @@ type ClientInterface interface {
|
||||
|
||||
// Logout request
|
||||
Logout(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// ListUISettings request
|
||||
ListUISettings(ctx context.Context, params *ListUISettingsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// CreateUISettingWithBody request with any body
|
||||
CreateUISettingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
CreateUISetting(ctx context.Context, body CreateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// DeleteUISetting request
|
||||
DeleteUISetting(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// GetUISetting request
|
||||
GetUISetting(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// UpdateUISettingWithBody request with any body
|
||||
UpdateUISettingWithBody(ctx context.Context, id UISettingID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
UpdateUISetting(ctx context.Context, id UISettingID, body UpdateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
}
|
||||
|
||||
func (c *Client) ListEulaVersions(ctx context.Context, params *ListEulaVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
@@ -2485,6 +2601,90 @@ func (c *Client) Logout(ctx context.Context, reqEditors ...RequestEditorFn) (*ht
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) ListUISettings(ctx context.Context, params *ListUISettingsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewListUISettingsRequest(c.Server, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) CreateUISettingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewCreateUISettingRequestWithBody(c.Server, contentType, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) CreateUISetting(ctx context.Context, body CreateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewCreateUISettingRequest(c.Server, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) DeleteUISetting(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewDeleteUISettingRequest(c.Server, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) GetUISetting(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewGetUISettingRequest(c.Server, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) UpdateUISettingWithBody(ctx context.Context, id UISettingID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewUpdateUISettingRequestWithBody(c.Server, id, contentType, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) UpdateUISetting(ctx context.Context, id UISettingID, body UpdateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewUpdateUISettingRequest(c.Server, id, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
// NewListEulaVersionsRequest generates requests for ListEulaVersions
|
||||
func NewListEulaVersionsRequest(server string, params *ListEulaVersionsParams) (*http.Request, error) {
|
||||
var err error
|
||||
@@ -4917,6 +5117,210 @@ func NewLogoutRequest(server string) (*http.Request, error) {
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewListUISettingsRequest generates requests for ListUISettings
|
||||
func NewListUISettingsRequest(server string, params *ListUISettingsParams) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/ui-settings")
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if params != nil {
|
||||
queryValues := queryURL.Query()
|
||||
|
||||
if params.Namespace != nil {
|
||||
|
||||
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil {
|
||||
return nil, err
|
||||
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
for k, v := range parsed {
|
||||
for _, v2 := range v {
|
||||
queryValues.Add(k, v2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
queryURL.RawQuery = queryValues.Encode()
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewCreateUISettingRequest calls the generic CreateUISetting builder with application/json body
|
||||
func NewCreateUISettingRequest(server string, body CreateUISettingJSONRequestBody) (*http.Request, error) {
|
||||
var bodyReader io.Reader
|
||||
buf, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bodyReader = bytes.NewReader(buf)
|
||||
return NewCreateUISettingRequestWithBody(server, "application/json", bodyReader)
|
||||
}
|
||||
|
||||
// NewCreateUISettingRequestWithBody generates requests for CreateUISetting with any type of body
|
||||
func NewCreateUISettingRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/ui-settings")
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", queryURL.String(), body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header.Add("Content-Type", contentType)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewDeleteUISettingRequest generates requests for DeleteUISetting
|
||||
func NewDeleteUISettingRequest(server string, id UISettingID) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
var pathParam0 string
|
||||
|
||||
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/ui-settings/%s", pathParam0)
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewGetUISettingRequest generates requests for GetUISetting
|
||||
func NewGetUISettingRequest(server string, id UISettingID) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
var pathParam0 string
|
||||
|
||||
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/ui-settings/%s", pathParam0)
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewUpdateUISettingRequest calls the generic UpdateUISetting builder with application/json body
|
||||
func NewUpdateUISettingRequest(server string, id UISettingID, body UpdateUISettingJSONRequestBody) (*http.Request, error) {
|
||||
var bodyReader io.Reader
|
||||
buf, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bodyReader = bytes.NewReader(buf)
|
||||
return NewUpdateUISettingRequestWithBody(server, id, "application/json", bodyReader)
|
||||
}
|
||||
|
||||
// NewUpdateUISettingRequestWithBody generates requests for UpdateUISetting with any type of body
|
||||
func NewUpdateUISettingRequestWithBody(server string, id UISettingID, contentType string, body io.Reader) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
var pathParam0 string
|
||||
|
||||
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/ui-settings/%s", pathParam0)
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("PATCH", queryURL.String(), body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header.Add("Content-Type", contentType)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
|
||||
for _, r := range c.RequestEditors {
|
||||
if err := r(ctx, req); err != nil {
|
||||
@@ -5142,6 +5546,25 @@ type ClientWithResponsesInterface interface {
|
||||
|
||||
// LogoutWithResponse request
|
||||
LogoutWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*LogoutResponse, error)
|
||||
|
||||
// ListUISettingsWithResponse request
|
||||
ListUISettingsWithResponse(ctx context.Context, params *ListUISettingsParams, reqEditors ...RequestEditorFn) (*ListUISettingsResponse, error)
|
||||
|
||||
// CreateUISettingWithBodyWithResponse request with any body
|
||||
CreateUISettingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUISettingResponse, error)
|
||||
|
||||
CreateUISettingWithResponse(ctx context.Context, body CreateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUISettingResponse, error)
|
||||
|
||||
// DeleteUISettingWithResponse request
|
||||
DeleteUISettingWithResponse(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*DeleteUISettingResponse, error)
|
||||
|
||||
// GetUISettingWithResponse request
|
||||
GetUISettingWithResponse(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*GetUISettingResponse, error)
|
||||
|
||||
// UpdateUISettingWithBodyWithResponse request with any body
|
||||
UpdateUISettingWithBodyWithResponse(ctx context.Context, id UISettingID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUISettingResponse, error)
|
||||
|
||||
UpdateUISettingWithResponse(ctx context.Context, id UISettingID, body UpdateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUISettingResponse, error)
|
||||
}
|
||||
|
||||
type ListEulaVersionsResponse struct {
|
||||
@@ -6572,6 +6995,138 @@ func (r LogoutResponse) StatusCode() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListUISettingsResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON200 *UISettingListResponse
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r ListUISettingsResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r ListUISettingsResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CreateUISettingResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON201 *UISetting
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r CreateUISettingResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r CreateUISettingResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type DeleteUISettingResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON404 *NotFound
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r DeleteUISettingResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r DeleteUISettingResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetUISettingResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON200 *UISetting
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON404 *NotFound
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r GetUISettingResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r GetUISettingResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type UpdateUISettingResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON200 *UISetting
|
||||
JSON400 *InvalidRequest
|
||||
JSON401 *Unauthorized
|
||||
JSON404 *NotFound
|
||||
JSON429 *TooManyRequests
|
||||
JSON500 *InternalError
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r UpdateUISettingResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r UpdateUISettingResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// ListEulaVersionsWithResponse request returning *ListEulaVersionsResponse
|
||||
func (c *ClientWithResponses) ListEulaVersionsWithResponse(ctx context.Context, params *ListEulaVersionsParams, reqEditors ...RequestEditorFn) (*ListEulaVersionsResponse, error) {
|
||||
rsp, err := c.ListEulaVersions(ctx, params, reqEditors...)
|
||||
@@ -7145,6 +7700,67 @@ func (c *ClientWithResponses) LogoutWithResponse(ctx context.Context, reqEditors
|
||||
return ParseLogoutResponse(rsp)
|
||||
}
|
||||
|
||||
// ListUISettingsWithResponse request returning *ListUISettingsResponse
|
||||
func (c *ClientWithResponses) ListUISettingsWithResponse(ctx context.Context, params *ListUISettingsParams, reqEditors ...RequestEditorFn) (*ListUISettingsResponse, error) {
|
||||
rsp, err := c.ListUISettings(ctx, params, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseListUISettingsResponse(rsp)
|
||||
}
|
||||
|
||||
// CreateUISettingWithBodyWithResponse request with arbitrary body returning *CreateUISettingResponse
|
||||
func (c *ClientWithResponses) CreateUISettingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUISettingResponse, error) {
|
||||
rsp, err := c.CreateUISettingWithBody(ctx, contentType, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseCreateUISettingResponse(rsp)
|
||||
}
|
||||
|
||||
func (c *ClientWithResponses) CreateUISettingWithResponse(ctx context.Context, body CreateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUISettingResponse, error) {
|
||||
rsp, err := c.CreateUISetting(ctx, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseCreateUISettingResponse(rsp)
|
||||
}
|
||||
|
||||
// DeleteUISettingWithResponse request returning *DeleteUISettingResponse
|
||||
func (c *ClientWithResponses) DeleteUISettingWithResponse(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*DeleteUISettingResponse, error) {
|
||||
rsp, err := c.DeleteUISetting(ctx, id, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseDeleteUISettingResponse(rsp)
|
||||
}
|
||||
|
||||
// GetUISettingWithResponse request returning *GetUISettingResponse
|
||||
func (c *ClientWithResponses) GetUISettingWithResponse(ctx context.Context, id UISettingID, reqEditors ...RequestEditorFn) (*GetUISettingResponse, error) {
|
||||
rsp, err := c.GetUISetting(ctx, id, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseGetUISettingResponse(rsp)
|
||||
}
|
||||
|
||||
// UpdateUISettingWithBodyWithResponse request with arbitrary body returning *UpdateUISettingResponse
|
||||
func (c *ClientWithResponses) UpdateUISettingWithBodyWithResponse(ctx context.Context, id UISettingID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUISettingResponse, error) {
|
||||
rsp, err := c.UpdateUISettingWithBody(ctx, id, contentType, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseUpdateUISettingResponse(rsp)
|
||||
}
|
||||
|
||||
func (c *ClientWithResponses) UpdateUISettingWithResponse(ctx context.Context, id UISettingID, body UpdateUISettingJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUISettingResponse, error) {
|
||||
rsp, err := c.UpdateUISetting(ctx, id, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseUpdateUISettingResponse(rsp)
|
||||
}
|
||||
|
||||
// ParseListEulaVersionsResponse parses an HTTP response from a ListEulaVersionsWithResponse call
|
||||
func ParseListEulaVersionsResponse(rsp *http.Response) (*ListEulaVersionsResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
@@ -10308,3 +10924,287 @@ func ParseLogoutResponse(rsp *http.Response) (*LogoutResponse, error) {
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseListUISettingsResponse parses an HTTP response from a ListUISettingsWithResponse call
|
||||
func ParseListUISettingsResponse(rsp *http.Response) (*ListUISettingsResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &ListUISettingsResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
||||
var dest UISettingListResponse
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON200 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseCreateUISettingResponse parses an HTTP response from a CreateUISettingWithResponse call
|
||||
func ParseCreateUISettingResponse(rsp *http.Response) (*CreateUISettingResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &CreateUISettingResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
|
||||
var dest UISetting
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON201 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseDeleteUISettingResponse parses an HTTP response from a DeleteUISettingWithResponse call
|
||||
func ParseDeleteUISettingResponse(rsp *http.Response) (*DeleteUISettingResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &DeleteUISettingResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
||||
var dest NotFound
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON404 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseGetUISettingResponse parses an HTTP response from a GetUISettingWithResponse call
|
||||
func ParseGetUISettingResponse(rsp *http.Response) (*GetUISettingResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &GetUISettingResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
||||
var dest UISetting
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON200 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
||||
var dest NotFound
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON404 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseUpdateUISettingResponse parses an HTTP response from a UpdateUISettingWithResponse call
|
||||
func ParseUpdateUISettingResponse(rsp *http.Response) (*UpdateUISettingResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &UpdateUISettingResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
||||
var dest UISetting
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON200 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
|
||||
var dest InvalidRequest
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON400 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
|
||||
var dest Unauthorized
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON401 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
||||
var dest NotFound
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON404 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
|
||||
var dest TooManyRequests
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON429 = &dest
|
||||
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
||||
var dest InternalError
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON500 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user