mirror of
https://github.com/hanzokms/cli.git
synced 2026-10-30 20:30:00 +00:00
5617 lines
215 KiB
Go
5617 lines
215 KiB
Go
// Package client provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.
|
|
package client
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
"net/http"
|
|
"net/url"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/oapi-codegen/runtime"
|
|
openapi_types "github.com/oapi-codegen/runtime/types"
|
|
)
|
|
|
|
const (
|
|
BearerAuthScopes = "bearerAuth.Scopes"
|
|
)
|
|
|
|
// Defines values for CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0AuthMethod.
|
|
const (
|
|
ServiceAccountToken CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0AuthMethod = "service-account-token"
|
|
)
|
|
|
|
// Defines values for CreateProjectJSONBodyType.
|
|
const (
|
|
Ai CreateProjectJSONBodyType = "ai"
|
|
CertManager CreateProjectJSONBodyType = "cert-manager"
|
|
Kms CreateProjectJSONBodyType = "kms"
|
|
Pam CreateProjectJSONBodyType = "pam"
|
|
SecretManager CreateProjectJSONBodyType = "secret-manager"
|
|
SecretScanning CreateProjectJSONBodyType = "secret-scanning"
|
|
Ssh CreateProjectJSONBodyType = "ssh"
|
|
)
|
|
|
|
// Defines values for SelectOrganizationV3JSONBodyUserAgent.
|
|
const (
|
|
Cli SelectOrganizationV3JSONBodyUserAgent = "cli"
|
|
)
|
|
|
|
// Defines values for ListSecretsV4ParamsViewSecretValue.
|
|
const (
|
|
ListSecretsV4ParamsViewSecretValueFalse ListSecretsV4ParamsViewSecretValue = "false"
|
|
ListSecretsV4ParamsViewSecretValueTrue ListSecretsV4ParamsViewSecretValue = "true"
|
|
)
|
|
|
|
// Defines values for ListSecretsV4ParamsExpandSecretReferences.
|
|
const (
|
|
ListSecretsV4ParamsExpandSecretReferencesFalse ListSecretsV4ParamsExpandSecretReferences = "false"
|
|
ListSecretsV4ParamsExpandSecretReferencesTrue ListSecretsV4ParamsExpandSecretReferences = "true"
|
|
)
|
|
|
|
// Defines values for ListSecretsV4ParamsRecursive.
|
|
const (
|
|
ListSecretsV4ParamsRecursiveFalse ListSecretsV4ParamsRecursive = "false"
|
|
ListSecretsV4ParamsRecursiveTrue ListSecretsV4ParamsRecursive = "true"
|
|
)
|
|
|
|
// Defines values for ListSecretsV4ParamsIncludeImports.
|
|
const (
|
|
ListSecretsV4ParamsIncludeImportsFalse ListSecretsV4ParamsIncludeImports = "false"
|
|
ListSecretsV4ParamsIncludeImportsTrue ListSecretsV4ParamsIncludeImports = "true"
|
|
)
|
|
|
|
// Defines values for DeleteSecretV4JSONBodyType.
|
|
const (
|
|
DeleteSecretV4JSONBodyTypePersonal DeleteSecretV4JSONBodyType = "personal"
|
|
DeleteSecretV4JSONBodyTypeShared DeleteSecretV4JSONBodyType = "shared"
|
|
)
|
|
|
|
// Defines values for GetSecretByNameV4ParamsType.
|
|
const (
|
|
GetSecretByNameV4ParamsTypePersonal GetSecretByNameV4ParamsType = "personal"
|
|
GetSecretByNameV4ParamsTypeShared GetSecretByNameV4ParamsType = "shared"
|
|
)
|
|
|
|
// Defines values for GetSecretByNameV4ParamsViewSecretValue.
|
|
const (
|
|
GetSecretByNameV4ParamsViewSecretValueFalse GetSecretByNameV4ParamsViewSecretValue = "false"
|
|
GetSecretByNameV4ParamsViewSecretValueTrue GetSecretByNameV4ParamsViewSecretValue = "true"
|
|
)
|
|
|
|
// Defines values for GetSecretByNameV4ParamsExpandSecretReferences.
|
|
const (
|
|
GetSecretByNameV4ParamsExpandSecretReferencesFalse GetSecretByNameV4ParamsExpandSecretReferences = "false"
|
|
GetSecretByNameV4ParamsExpandSecretReferencesTrue GetSecretByNameV4ParamsExpandSecretReferences = "true"
|
|
)
|
|
|
|
// Defines values for GetSecretByNameV4ParamsIncludeImports.
|
|
const (
|
|
False GetSecretByNameV4ParamsIncludeImports = "false"
|
|
True GetSecretByNameV4ParamsIncludeImports = "true"
|
|
)
|
|
|
|
// Defines values for UpdateSecretV4JSONBodyType.
|
|
const (
|
|
UpdateSecretV4JSONBodyTypePersonal UpdateSecretV4JSONBodyType = "personal"
|
|
UpdateSecretV4JSONBodyTypeShared UpdateSecretV4JSONBodyType = "shared"
|
|
)
|
|
|
|
// Defines values for CreateSecretV4JSONBodyType.
|
|
const (
|
|
CreateSecretV4JSONBodyTypePersonal CreateSecretV4JSONBodyType = "personal"
|
|
CreateSecretV4JSONBodyTypeShared CreateSecretV4JSONBodyType = "shared"
|
|
)
|
|
|
|
// AdminSignUpJSONBody defines parameters for AdminSignUp.
|
|
type AdminSignUpJSONBody struct {
|
|
Email openapi_types.Email `json:"email"`
|
|
FirstName string `json:"firstName"`
|
|
LastName *string `json:"lastName,omitempty"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
// AttachTokenAuthJSONBody defines parameters for AttachTokenAuth.
|
|
type AttachTokenAuthJSONBody struct {
|
|
// AccessTokenMaxTTL The maximum lifetime for an access token in seconds.
|
|
AccessTokenMaxTTL *int `json:"accessTokenMaxTTL,omitempty"`
|
|
|
|
// AccessTokenNumUsesLimit The maximum number of times that an access token can be used.
|
|
AccessTokenNumUsesLimit *int `json:"accessTokenNumUsesLimit,omitempty"`
|
|
|
|
// AccessTokenTTL The lifetime for an access token in seconds.
|
|
AccessTokenTTL *int `json:"accessTokenTTL,omitempty"`
|
|
|
|
// AccessTokenTrustedIps The IPs or CIDR ranges that access tokens can be used from.
|
|
AccessTokenTrustedIps *[]struct {
|
|
IpAddress string `json:"ipAddress"`
|
|
} `json:"accessTokenTrustedIps,omitempty"`
|
|
}
|
|
|
|
// CreateTokenAuthTokenJSONBody defines parameters for CreateTokenAuthToken.
|
|
type CreateTokenAuthTokenJSONBody struct {
|
|
// Name The name of the token to create.
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// SubOrganizationName The sub organization name to scope the token to.
|
|
SubOrganizationName *string `json:"subOrganizationName,omitempty"`
|
|
}
|
|
|
|
// CreateMachineIdentityJSONBody defines parameters for CreateMachineIdentity.
|
|
type CreateMachineIdentityJSONBody struct {
|
|
// HasDeleteProtection Prevents deletion of the identity when enabled.
|
|
HasDeleteProtection *bool `json:"hasDeleteProtection,omitempty"`
|
|
Metadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
} `json:"metadata,omitempty"`
|
|
|
|
// Name The name of the identity to create.
|
|
Name string `json:"name"`
|
|
|
|
// OrganizationId The organization ID to which the identity belongs.
|
|
OrganizationId string `json:"organizationId"`
|
|
|
|
// Role The role of the identity. Possible values are 'no-access', 'member', and 'admin'.
|
|
Role *string `json:"role,omitempty"`
|
|
}
|
|
|
|
// CreateKubernetesPamResourceJSONBody defines parameters for CreateKubernetesPamResource.
|
|
type CreateKubernetesPamResourceJSONBody struct {
|
|
ConnectionDetails struct {
|
|
SslCertificate *string `json:"sslCertificate,omitempty"`
|
|
SslRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
Url string `json:"url"`
|
|
} `json:"connectionDetails"`
|
|
GatewayId openapi_types.UUID `json:"gatewayId"`
|
|
Name string `json:"name"`
|
|
ProjectId openapi_types.UUID `json:"projectId"`
|
|
RotationAccountCredentials *CreateKubernetesPamResourceJSONBody_RotationAccountCredentials `json:"rotationAccountCredentials"`
|
|
}
|
|
|
|
// CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0 defines parameters for CreateKubernetesPamResource.
|
|
type CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0 struct {
|
|
AuthMethod CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0AuthMethod `json:"authMethod"`
|
|
ServiceAccountToken string `json:"serviceAccountToken"`
|
|
}
|
|
|
|
// CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0AuthMethod defines parameters for CreateKubernetesPamResource.
|
|
type CreateKubernetesPamResourceJSONBodyRotationAccountCredentials0AuthMethod string
|
|
|
|
// CreateKubernetesPamResourceJSONBody_RotationAccountCredentials defines parameters for CreateKubernetesPamResource.
|
|
type CreateKubernetesPamResourceJSONBody_RotationAccountCredentials struct {
|
|
union json.RawMessage
|
|
}
|
|
|
|
// CreateRedisPamResourceJSONBody defines parameters for CreateRedisPamResource.
|
|
type CreateRedisPamResourceJSONBody struct {
|
|
ConnectionDetails struct {
|
|
Host string `json:"host"`
|
|
Port float32 `json:"port"`
|
|
SslCertificate *string `json:"sslCertificate,omitempty"`
|
|
SslEnabled bool `json:"sslEnabled"`
|
|
SslRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
} `json:"connectionDetails"`
|
|
GatewayId openapi_types.UUID `json:"gatewayId"`
|
|
Name string `json:"name"`
|
|
ProjectId openapi_types.UUID `json:"projectId"`
|
|
RotationAccountCredentials *struct {
|
|
Password *string `json:"password,omitempty"`
|
|
Username *string `json:"username,omitempty"`
|
|
} `json:"rotationAccountCredentials"`
|
|
}
|
|
|
|
// CreateProjectJSONBody defines parameters for CreateProject.
|
|
type CreateProjectJSONBody struct {
|
|
HasDeleteProtection *bool `json:"hasDeleteProtection,omitempty"`
|
|
KmsKeyId *string `json:"kmsKeyId,omitempty"`
|
|
|
|
// ProjectDescription An optional description label for the project.
|
|
ProjectDescription *string `json:"projectDescription,omitempty"`
|
|
|
|
// ProjectName The name of the project to create.
|
|
ProjectName string `json:"projectName"`
|
|
ShouldCreateDefaultEnvs *bool `json:"shouldCreateDefaultEnvs,omitempty"`
|
|
|
|
// Slug An optional slug for the project.
|
|
Slug *string `json:"slug,omitempty"`
|
|
|
|
// Template The name of the project template, if specified, to apply to this project.
|
|
Template *string `json:"template,omitempty"`
|
|
Type *CreateProjectJSONBodyType `json:"type,omitempty"`
|
|
}
|
|
|
|
// CreateProjectJSONBodyType defines parameters for CreateProject.
|
|
type CreateProjectJSONBodyType string
|
|
|
|
// SelectOrganizationV3JSONBody defines parameters for SelectOrganizationV3.
|
|
type SelectOrganizationV3JSONBody struct {
|
|
OrganizationId string `json:"organizationId"`
|
|
UserAgent *SelectOrganizationV3JSONBodyUserAgent `json:"userAgent,omitempty"`
|
|
}
|
|
|
|
// SelectOrganizationV3JSONBodyUserAgent defines parameters for SelectOrganizationV3.
|
|
type SelectOrganizationV3JSONBodyUserAgent string
|
|
|
|
// ListSecretsV4Params defines parameters for ListSecretsV4.
|
|
type ListSecretsV4Params struct {
|
|
// MetadataFilter The secret metadata key-value pairs to filter secrets by. When querying for multiple metadata pairs, the query is treated as an AND operation. Secret metadata format is key=value1,value=value2|key=value3,value=value4.
|
|
MetadataFilter *string `form:"metadataFilter,omitempty" json:"metadataFilter,omitempty"`
|
|
|
|
// ProjectId The ID of the project to list secrets from.
|
|
ProjectId *string `form:"projectId,omitempty" json:"projectId,omitempty"`
|
|
|
|
// Environment The slug of the environment to list secrets from.
|
|
Environment *string `form:"environment,omitempty" json:"environment,omitempty"`
|
|
|
|
// SecretPath The secret path to list secrets from.
|
|
SecretPath *string `form:"secretPath,omitempty" json:"secretPath,omitempty"`
|
|
|
|
// ViewSecretValue Whether or not to retrieve the secret value.
|
|
ViewSecretValue *ListSecretsV4ParamsViewSecretValue `form:"viewSecretValue,omitempty" json:"viewSecretValue,omitempty"`
|
|
|
|
// ExpandSecretReferences Whether or not to expand secret references.
|
|
ExpandSecretReferences *ListSecretsV4ParamsExpandSecretReferences `form:"expandSecretReferences,omitempty" json:"expandSecretReferences,omitempty"`
|
|
|
|
// Recursive Whether or not to fetch all secrets from the specified base path, and all of its subdirectories. Note, the max depth is 20 deep.
|
|
Recursive *ListSecretsV4ParamsRecursive `form:"recursive,omitempty" json:"recursive,omitempty"`
|
|
|
|
// IncludeImports Weather to include imported secrets or not.
|
|
IncludeImports *ListSecretsV4ParamsIncludeImports `form:"include_imports,omitempty" json:"include_imports,omitempty"`
|
|
|
|
// TagSlugs The comma separated tag slugs to filter secrets.
|
|
TagSlugs *string `form:"tagSlugs,omitempty" json:"tagSlugs,omitempty"`
|
|
}
|
|
|
|
// ListSecretsV4ParamsViewSecretValue defines parameters for ListSecretsV4.
|
|
type ListSecretsV4ParamsViewSecretValue string
|
|
|
|
// ListSecretsV4ParamsExpandSecretReferences defines parameters for ListSecretsV4.
|
|
type ListSecretsV4ParamsExpandSecretReferences string
|
|
|
|
// ListSecretsV4ParamsRecursive defines parameters for ListSecretsV4.
|
|
type ListSecretsV4ParamsRecursive string
|
|
|
|
// ListSecretsV4ParamsIncludeImports defines parameters for ListSecretsV4.
|
|
type ListSecretsV4ParamsIncludeImports string
|
|
|
|
// DeleteSecretV4JSONBody defines parameters for DeleteSecretV4.
|
|
type DeleteSecretV4JSONBody struct {
|
|
// Environment The slug of the environment where the secret is located.
|
|
Environment string `json:"environment"`
|
|
|
|
// ProjectId The ID of the project where the secret is located.
|
|
ProjectId string `json:"projectId"`
|
|
|
|
// SecretPath The path of the secret.
|
|
SecretPath *string `json:"secretPath,omitempty"`
|
|
|
|
// Type The type of the secret to delete.
|
|
Type *DeleteSecretV4JSONBodyType `json:"type,omitempty"`
|
|
}
|
|
|
|
// DeleteSecretV4JSONBodyType defines parameters for DeleteSecretV4.
|
|
type DeleteSecretV4JSONBodyType string
|
|
|
|
// GetSecretByNameV4Params defines parameters for GetSecretByNameV4.
|
|
type GetSecretByNameV4Params struct {
|
|
// ProjectId The ID of the project to get the secret from.
|
|
ProjectId string `form:"projectId" json:"projectId"`
|
|
|
|
// Environment The slug of the environment to get the secret from.
|
|
Environment *string `form:"environment,omitempty" json:"environment,omitempty"`
|
|
|
|
// SecretPath The path of the secret to get.
|
|
SecretPath *string `form:"secretPath,omitempty" json:"secretPath,omitempty"`
|
|
|
|
// Version The version of the secret to get.
|
|
Version *float32 `form:"version,omitempty" json:"version,omitempty"`
|
|
|
|
// Type The type of the secret to get.
|
|
Type *GetSecretByNameV4ParamsType `form:"type,omitempty" json:"type,omitempty"`
|
|
|
|
// ViewSecretValue Whether or not to retrieve the secret value.
|
|
ViewSecretValue *GetSecretByNameV4ParamsViewSecretValue `form:"viewSecretValue,omitempty" json:"viewSecretValue,omitempty"`
|
|
|
|
// ExpandSecretReferences Whether or not to expand secret references.
|
|
ExpandSecretReferences *GetSecretByNameV4ParamsExpandSecretReferences `form:"expandSecretReferences,omitempty" json:"expandSecretReferences,omitempty"`
|
|
|
|
// IncludeImports Weather to include imported secrets or not.
|
|
IncludeImports *GetSecretByNameV4ParamsIncludeImports `form:"include_imports,omitempty" json:"include_imports,omitempty"`
|
|
}
|
|
|
|
// GetSecretByNameV4ParamsType defines parameters for GetSecretByNameV4.
|
|
type GetSecretByNameV4ParamsType string
|
|
|
|
// GetSecretByNameV4ParamsViewSecretValue defines parameters for GetSecretByNameV4.
|
|
type GetSecretByNameV4ParamsViewSecretValue string
|
|
|
|
// GetSecretByNameV4ParamsExpandSecretReferences defines parameters for GetSecretByNameV4.
|
|
type GetSecretByNameV4ParamsExpandSecretReferences string
|
|
|
|
// GetSecretByNameV4ParamsIncludeImports defines parameters for GetSecretByNameV4.
|
|
type GetSecretByNameV4ParamsIncludeImports string
|
|
|
|
// UpdateSecretV4JSONBody defines parameters for UpdateSecretV4.
|
|
type UpdateSecretV4JSONBody struct {
|
|
// Environment The slug of the environment where the secret is located.
|
|
Environment string `json:"environment"`
|
|
Metadata *map[string]string `json:"metadata,omitempty"`
|
|
|
|
// NewSecretName The new name for the secret.
|
|
NewSecretName *string `json:"newSecretName,omitempty"`
|
|
|
|
// ProjectId The ID of the project to update the secret in.
|
|
ProjectId string `json:"projectId"`
|
|
|
|
// SecretComment Update comment to the secret.
|
|
SecretComment *string `json:"secretComment,omitempty"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
|
|
// SecretPath The default path for secrets to update or upsert, if not provided in the secret details.
|
|
SecretPath *string `json:"secretPath,omitempty"`
|
|
|
|
// SecretReminderNote Note to be attached in notification email.
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
|
|
// SecretReminderRecipients An array of user IDs that will receive the reminder email. If not specified, all project members will receive the reminder email.
|
|
SecretReminderRecipients *[]string `json:"secretReminderRecipients,omitempty"`
|
|
|
|
// SecretReminderRepeatDays Interval for secret rotation notifications, measured in days.
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
|
|
// SecretValue The new value of the secret.
|
|
SecretValue *string `json:"secretValue,omitempty"`
|
|
|
|
// SkipMultilineEncoding Skip multiline encoding for the secret value.
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding,omitempty"`
|
|
|
|
// TagIds The ID of the tags to be attached to the updated secret.
|
|
TagIds *[]string `json:"tagIds,omitempty"`
|
|
|
|
// Type The type of the secret to update.
|
|
Type *UpdateSecretV4JSONBodyType `json:"type,omitempty"`
|
|
}
|
|
|
|
// UpdateSecretV4JSONBodyType defines parameters for UpdateSecretV4.
|
|
type UpdateSecretV4JSONBodyType string
|
|
|
|
// CreateSecretV4JSONBody defines parameters for CreateSecretV4.
|
|
type CreateSecretV4JSONBody struct {
|
|
// Environment The slug of the environment to create the secret in.
|
|
Environment string `json:"environment"`
|
|
|
|
// ProjectId The ID of the project to create the secret in.
|
|
ProjectId string `json:"projectId"`
|
|
|
|
// SecretComment Attach a comment to the secret.
|
|
SecretComment *string `json:"secretComment,omitempty"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
|
|
// SecretPath The path to create the secret in.
|
|
SecretPath *string `json:"secretPath,omitempty"`
|
|
|
|
// SecretReminderNote Note to be attached in notification email.
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
|
|
// SecretReminderRepeatDays Interval for secret rotation notifications, measured in days.
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
|
|
// SecretValue The value of the secret to create.
|
|
SecretValue string `json:"secretValue"`
|
|
|
|
// SkipMultilineEncoding Skip multiline encoding for the secret value.
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding,omitempty"`
|
|
|
|
// TagIds The ID of the tags to be attached to the created secret.
|
|
TagIds *[]string `json:"tagIds,omitempty"`
|
|
|
|
// Type The type of the secret to create.
|
|
Type *CreateSecretV4JSONBodyType `json:"type,omitempty"`
|
|
}
|
|
|
|
// CreateSecretV4JSONBodyType defines parameters for CreateSecretV4.
|
|
type CreateSecretV4JSONBodyType string
|
|
|
|
// AdminSignUpJSONRequestBody defines body for AdminSignUp for application/json ContentType.
|
|
type AdminSignUpJSONRequestBody AdminSignUpJSONBody
|
|
|
|
// AttachTokenAuthJSONRequestBody defines body for AttachTokenAuth for application/json ContentType.
|
|
type AttachTokenAuthJSONRequestBody AttachTokenAuthJSONBody
|
|
|
|
// CreateTokenAuthTokenJSONRequestBody defines body for CreateTokenAuthToken for application/json ContentType.
|
|
type CreateTokenAuthTokenJSONRequestBody CreateTokenAuthTokenJSONBody
|
|
|
|
// CreateMachineIdentityJSONRequestBody defines body for CreateMachineIdentity for application/json ContentType.
|
|
type CreateMachineIdentityJSONRequestBody CreateMachineIdentityJSONBody
|
|
|
|
// CreateKubernetesPamResourceJSONRequestBody defines body for CreateKubernetesPamResource for application/json ContentType.
|
|
type CreateKubernetesPamResourceJSONRequestBody CreateKubernetesPamResourceJSONBody
|
|
|
|
// CreateRedisPamResourceJSONRequestBody defines body for CreateRedisPamResource for application/json ContentType.
|
|
type CreateRedisPamResourceJSONRequestBody CreateRedisPamResourceJSONBody
|
|
|
|
// CreateProjectJSONRequestBody defines body for CreateProject for application/json ContentType.
|
|
type CreateProjectJSONRequestBody CreateProjectJSONBody
|
|
|
|
// SelectOrganizationV3JSONRequestBody defines body for SelectOrganizationV3 for application/json ContentType.
|
|
type SelectOrganizationV3JSONRequestBody SelectOrganizationV3JSONBody
|
|
|
|
// DeleteSecretV4JSONRequestBody defines body for DeleteSecretV4 for application/json ContentType.
|
|
type DeleteSecretV4JSONRequestBody DeleteSecretV4JSONBody
|
|
|
|
// UpdateSecretV4JSONRequestBody defines body for UpdateSecretV4 for application/json ContentType.
|
|
type UpdateSecretV4JSONRequestBody UpdateSecretV4JSONBody
|
|
|
|
// CreateSecretV4JSONRequestBody defines body for CreateSecretV4 for application/json ContentType.
|
|
type CreateSecretV4JSONRequestBody CreateSecretV4JSONBody
|
|
|
|
// RequestEditorFn is the function signature for the RequestEditor callback function
|
|
type RequestEditorFn func(ctx context.Context, req *http.Request) error
|
|
|
|
// Doer performs HTTP requests.
|
|
//
|
|
// The standard http.Client implements this interface.
|
|
type HttpRequestDoer interface {
|
|
Do(req *http.Request) (*http.Response, error)
|
|
}
|
|
|
|
// Client which conforms to the OpenAPI3 specification for this service.
|
|
type Client struct {
|
|
// The endpoint of the server conforming to this interface, with scheme,
|
|
// https://api.deepmap.com for example. This can contain a path relative
|
|
// to the server, such as https://api.deepmap.com/dev-test, and all the
|
|
// paths in the swagger spec will be appended to the server.
|
|
Server string
|
|
|
|
// Doer for performing requests, typically a *http.Client with any
|
|
// customized settings, such as certificate chains.
|
|
Client HttpRequestDoer
|
|
|
|
// A list of callbacks for modifying requests which are generated before sending over
|
|
// the network.
|
|
RequestEditors []RequestEditorFn
|
|
}
|
|
|
|
// ClientOption allows setting custom parameters during construction
|
|
type ClientOption func(*Client) error
|
|
|
|
// Creates a new Client, with reasonable defaults
|
|
func NewClient(server string, opts ...ClientOption) (*Client, error) {
|
|
// create a client with sane default values
|
|
client := Client{
|
|
Server: server,
|
|
}
|
|
// mutate client and add all optional params
|
|
for _, o := range opts {
|
|
if err := o(&client); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
// ensure the server URL always has a trailing slash
|
|
if !strings.HasSuffix(client.Server, "/") {
|
|
client.Server += "/"
|
|
}
|
|
// create httpClient, if not already present
|
|
if client.Client == nil {
|
|
client.Client = &http.Client{}
|
|
}
|
|
return &client, nil
|
|
}
|
|
|
|
// WithHTTPClient allows overriding the default Doer, which is
|
|
// automatically created using http.Client. This is useful for tests.
|
|
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
|
|
return func(c *Client) error {
|
|
c.Client = doer
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// WithRequestEditorFn allows setting up a callback function, which will be
|
|
// called right before sending the request. This can be used to mutate the request.
|
|
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
|
|
return func(c *Client) error {
|
|
c.RequestEditors = append(c.RequestEditors, fn)
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// The interface specification for the client above.
|
|
type ClientInterface interface {
|
|
// AdminSignUpWithBody request with any body
|
|
AdminSignUpWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
AdminSignUp(ctx context.Context, body AdminSignUpJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// RefreshAuthToken request
|
|
RefreshAuthToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// AttachTokenAuthWithBody request with any body
|
|
AttachTokenAuthWithBody(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
AttachTokenAuth(ctx context.Context, identityId string, body AttachTokenAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// CreateTokenAuthTokenWithBody request with any body
|
|
CreateTokenAuthTokenWithBody(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
CreateTokenAuthToken(ctx context.Context, identityId string, body CreateTokenAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// CreateMachineIdentityWithBody request with any body
|
|
CreateMachineIdentityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
CreateMachineIdentity(ctx context.Context, body CreateMachineIdentityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// CreateKubernetesPamResourceWithBody request with any body
|
|
CreateKubernetesPamResourceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
CreateKubernetesPamResource(ctx context.Context, body CreateKubernetesPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// CreateRedisPamResourceWithBody request with any body
|
|
CreateRedisPamResourceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
CreateRedisPamResource(ctx context.Context, body CreateRedisPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// CreateProjectWithBody request with any body
|
|
CreateProjectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
CreateProject(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetRelays request
|
|
GetRelays(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// ListGateways request
|
|
ListGateways(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// SelectOrganizationV3WithBody request with any body
|
|
SelectOrganizationV3WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
SelectOrganizationV3(ctx context.Context, body SelectOrganizationV3JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// ListSecretsV4 request
|
|
ListSecretsV4(ctx context.Context, params *ListSecretsV4Params, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// DeleteSecretV4WithBody request with any body
|
|
DeleteSecretV4WithBody(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
DeleteSecretV4(ctx context.Context, secretName string, body DeleteSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetSecretByNameV4 request
|
|
GetSecretByNameV4(ctx context.Context, secretName string, params *GetSecretByNameV4Params, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// UpdateSecretV4WithBody request with any body
|
|
UpdateSecretV4WithBody(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
UpdateSecretV4(ctx context.Context, secretName string, body UpdateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// CreateSecretV4WithBody request with any body
|
|
CreateSecretV4WithBody(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
CreateSecretV4(ctx context.Context, secretName string, body CreateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
}
|
|
|
|
func (c *Client) AdminSignUpWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewAdminSignUpRequestWithBody(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) AdminSignUp(ctx context.Context, body AdminSignUpJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewAdminSignUpRequest(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) RefreshAuthToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewRefreshAuthTokenRequest(c.Server)
|
|
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) AttachTokenAuthWithBody(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewAttachTokenAuthRequestWithBody(c.Server, identityId, 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) AttachTokenAuth(ctx context.Context, identityId string, body AttachTokenAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewAttachTokenAuthRequest(c.Server, identityId, 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) CreateTokenAuthTokenWithBody(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateTokenAuthTokenRequestWithBody(c.Server, identityId, 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) CreateTokenAuthToken(ctx context.Context, identityId string, body CreateTokenAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateTokenAuthTokenRequest(c.Server, identityId, 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) CreateMachineIdentityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateMachineIdentityRequestWithBody(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) CreateMachineIdentity(ctx context.Context, body CreateMachineIdentityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateMachineIdentityRequest(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) CreateKubernetesPamResourceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateKubernetesPamResourceRequestWithBody(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) CreateKubernetesPamResource(ctx context.Context, body CreateKubernetesPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateKubernetesPamResourceRequest(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) CreateRedisPamResourceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateRedisPamResourceRequestWithBody(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) CreateRedisPamResource(ctx context.Context, body CreateRedisPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateRedisPamResourceRequest(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) CreateProjectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateProjectRequestWithBody(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) CreateProject(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateProjectRequest(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) GetRelays(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetRelaysRequest(c.Server)
|
|
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) ListGateways(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewListGatewaysRequest(c.Server)
|
|
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) SelectOrganizationV3WithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewSelectOrganizationV3RequestWithBody(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) SelectOrganizationV3(ctx context.Context, body SelectOrganizationV3JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewSelectOrganizationV3Request(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) ListSecretsV4(ctx context.Context, params *ListSecretsV4Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewListSecretsV4Request(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) DeleteSecretV4WithBody(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteSecretV4RequestWithBody(c.Server, secretName, 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) DeleteSecretV4(ctx context.Context, secretName string, body DeleteSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteSecretV4Request(c.Server, secretName, 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) GetSecretByNameV4(ctx context.Context, secretName string, params *GetSecretByNameV4Params, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetSecretByNameV4Request(c.Server, secretName, 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) UpdateSecretV4WithBody(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewUpdateSecretV4RequestWithBody(c.Server, secretName, 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) UpdateSecretV4(ctx context.Context, secretName string, body UpdateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewUpdateSecretV4Request(c.Server, secretName, 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) CreateSecretV4WithBody(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateSecretV4RequestWithBody(c.Server, secretName, 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) CreateSecretV4(ctx context.Context, secretName string, body CreateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewCreateSecretV4Request(c.Server, secretName, 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)
|
|
}
|
|
|
|
// NewAdminSignUpRequest calls the generic AdminSignUp builder with application/json body
|
|
func NewAdminSignUpRequest(server string, body AdminSignUpJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewAdminSignUpRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewAdminSignUpRequestWithBody generates requests for AdminSignUp with any type of body
|
|
func NewAdminSignUpRequestWithBody(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("/api/v1/admin/signup")
|
|
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
|
|
}
|
|
|
|
// NewRefreshAuthTokenRequest generates requests for RefreshAuthToken
|
|
func NewRefreshAuthTokenRequest(server string) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v1/auth/token")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("POST", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewAttachTokenAuthRequest calls the generic AttachTokenAuth builder with application/json body
|
|
func NewAttachTokenAuthRequest(server string, identityId string, body AttachTokenAuthJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewAttachTokenAuthRequestWithBody(server, identityId, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewAttachTokenAuthRequestWithBody generates requests for AttachTokenAuth with any type of body
|
|
func NewAttachTokenAuthRequestWithBody(server string, identityId string, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "identityId", runtime.ParamLocationPath, identityId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v1/auth/token-auth/identities/%s", pathParam0)
|
|
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
|
|
}
|
|
|
|
// NewCreateTokenAuthTokenRequest calls the generic CreateTokenAuthToken builder with application/json body
|
|
func NewCreateTokenAuthTokenRequest(server string, identityId string, body CreateTokenAuthTokenJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewCreateTokenAuthTokenRequestWithBody(server, identityId, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewCreateTokenAuthTokenRequestWithBody generates requests for CreateTokenAuthToken with any type of body
|
|
func NewCreateTokenAuthTokenRequestWithBody(server string, identityId string, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "identityId", runtime.ParamLocationPath, identityId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v1/auth/token-auth/identities/%s/tokens", pathParam0)
|
|
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
|
|
}
|
|
|
|
// NewCreateMachineIdentityRequest calls the generic CreateMachineIdentity builder with application/json body
|
|
func NewCreateMachineIdentityRequest(server string, body CreateMachineIdentityJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewCreateMachineIdentityRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewCreateMachineIdentityRequestWithBody generates requests for CreateMachineIdentity with any type of body
|
|
func NewCreateMachineIdentityRequestWithBody(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("/api/v1/identities")
|
|
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
|
|
}
|
|
|
|
// NewCreateKubernetesPamResourceRequest calls the generic CreateKubernetesPamResource builder with application/json body
|
|
func NewCreateKubernetesPamResourceRequest(server string, body CreateKubernetesPamResourceJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewCreateKubernetesPamResourceRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewCreateKubernetesPamResourceRequestWithBody generates requests for CreateKubernetesPamResource with any type of body
|
|
func NewCreateKubernetesPamResourceRequestWithBody(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("/api/v1/pam/resources/kubernetes")
|
|
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
|
|
}
|
|
|
|
// NewCreateRedisPamResourceRequest calls the generic CreateRedisPamResource builder with application/json body
|
|
func NewCreateRedisPamResourceRequest(server string, body CreateRedisPamResourceJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewCreateRedisPamResourceRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewCreateRedisPamResourceRequestWithBody generates requests for CreateRedisPamResource with any type of body
|
|
func NewCreateRedisPamResourceRequestWithBody(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("/api/v1/pam/resources/redis")
|
|
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
|
|
}
|
|
|
|
// NewCreateProjectRequest calls the generic CreateProject builder with application/json body
|
|
func NewCreateProjectRequest(server string, body CreateProjectJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewCreateProjectRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewCreateProjectRequestWithBody generates requests for CreateProject with any type of body
|
|
func NewCreateProjectRequestWithBody(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("/api/v1/projects")
|
|
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
|
|
}
|
|
|
|
// NewGetRelaysRequest generates requests for GetRelays
|
|
func NewGetRelaysRequest(server string) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v1/relays")
|
|
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
|
|
}
|
|
|
|
// NewListGatewaysRequest generates requests for ListGateways
|
|
func NewListGatewaysRequest(server string) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v2/gateways")
|
|
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
|
|
}
|
|
|
|
// NewSelectOrganizationV3Request calls the generic SelectOrganizationV3 builder with application/json body
|
|
func NewSelectOrganizationV3Request(server string, body SelectOrganizationV3JSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewSelectOrganizationV3RequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewSelectOrganizationV3RequestWithBody generates requests for SelectOrganizationV3 with any type of body
|
|
func NewSelectOrganizationV3RequestWithBody(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("/api/v3/auth/select-organization")
|
|
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
|
|
}
|
|
|
|
// NewListSecretsV4Request generates requests for ListSecretsV4
|
|
func NewListSecretsV4Request(server string, params *ListSecretsV4Params) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v4/secrets")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if params != nil {
|
|
queryValues := queryURL.Query()
|
|
|
|
if params.MetadataFilter != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "metadataFilter", runtime.ParamLocationQuery, *params.MetadataFilter); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.ProjectId != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "projectId", runtime.ParamLocationQuery, *params.ProjectId); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.Environment != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "environment", runtime.ParamLocationQuery, *params.Environment); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.SecretPath != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "secretPath", runtime.ParamLocationQuery, *params.SecretPath); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.ViewSecretValue != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "viewSecretValue", runtime.ParamLocationQuery, *params.ViewSecretValue); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.ExpandSecretReferences != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "expandSecretReferences", runtime.ParamLocationQuery, *params.ExpandSecretReferences); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.Recursive != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "recursive", runtime.ParamLocationQuery, *params.Recursive); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.IncludeImports != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "include_imports", runtime.ParamLocationQuery, *params.IncludeImports); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.TagSlugs != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tagSlugs", runtime.ParamLocationQuery, *params.TagSlugs); 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
|
|
}
|
|
|
|
// NewDeleteSecretV4Request calls the generic DeleteSecretV4 builder with application/json body
|
|
func NewDeleteSecretV4Request(server string, secretName string, body DeleteSecretV4JSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewDeleteSecretV4RequestWithBody(server, secretName, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewDeleteSecretV4RequestWithBody generates requests for DeleteSecretV4 with any type of body
|
|
func NewDeleteSecretV4RequestWithBody(server string, secretName string, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "secretName", runtime.ParamLocationPath, secretName)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v4/secrets/%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(), body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req.Header.Add("Content-Type", contentType)
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetSecretByNameV4Request generates requests for GetSecretByNameV4
|
|
func NewGetSecretByNameV4Request(server string, secretName string, params *GetSecretByNameV4Params) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "secretName", runtime.ParamLocationPath, secretName)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v4/secrets/%s", pathParam0)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if params != nil {
|
|
queryValues := queryURL.Query()
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "projectId", runtime.ParamLocationQuery, params.ProjectId); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
if params.Environment != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "environment", runtime.ParamLocationQuery, *params.Environment); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.SecretPath != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "secretPath", runtime.ParamLocationQuery, *params.SecretPath); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.Version != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "version", runtime.ParamLocationQuery, *params.Version); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.Type != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.ViewSecretValue != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "viewSecretValue", runtime.ParamLocationQuery, *params.ViewSecretValue); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.ExpandSecretReferences != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "expandSecretReferences", runtime.ParamLocationQuery, *params.ExpandSecretReferences); 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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.IncludeImports != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "include_imports", runtime.ParamLocationQuery, *params.IncludeImports); 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
|
|
}
|
|
|
|
// NewUpdateSecretV4Request calls the generic UpdateSecretV4 builder with application/json body
|
|
func NewUpdateSecretV4Request(server string, secretName string, body UpdateSecretV4JSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewUpdateSecretV4RequestWithBody(server, secretName, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewUpdateSecretV4RequestWithBody generates requests for UpdateSecretV4 with any type of body
|
|
func NewUpdateSecretV4RequestWithBody(server string, secretName string, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "secretName", runtime.ParamLocationPath, secretName)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v4/secrets/%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
|
|
}
|
|
|
|
// NewCreateSecretV4Request calls the generic CreateSecretV4 builder with application/json body
|
|
func NewCreateSecretV4Request(server string, secretName string, body CreateSecretV4JSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewCreateSecretV4RequestWithBody(server, secretName, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewCreateSecretV4RequestWithBody generates requests for CreateSecretV4 with any type of body
|
|
func NewCreateSecretV4RequestWithBody(server string, secretName string, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "secretName", runtime.ParamLocationPath, secretName)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/api/v4/secrets/%s", pathParam0)
|
|
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
|
|
}
|
|
|
|
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 {
|
|
return err
|
|
}
|
|
}
|
|
for _, r := range additionalEditors {
|
|
if err := r(ctx, req); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// ClientWithResponses builds on ClientInterface to offer response payloads
|
|
type ClientWithResponses struct {
|
|
ClientInterface
|
|
}
|
|
|
|
// NewClientWithResponses creates a new ClientWithResponses, which wraps
|
|
// Client with return type handling
|
|
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
|
|
client, err := NewClient(server, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &ClientWithResponses{client}, nil
|
|
}
|
|
|
|
// WithBaseURL overrides the baseURL.
|
|
func WithBaseURL(baseURL string) ClientOption {
|
|
return func(c *Client) error {
|
|
newBaseURL, err := url.Parse(baseURL)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
c.Server = newBaseURL.String()
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// ClientWithResponsesInterface is the interface specification for the client with responses above.
|
|
type ClientWithResponsesInterface interface {
|
|
// AdminSignUpWithBodyWithResponse request with any body
|
|
AdminSignUpWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AdminSignUpResponse, error)
|
|
|
|
AdminSignUpWithResponse(ctx context.Context, body AdminSignUpJSONRequestBody, reqEditors ...RequestEditorFn) (*AdminSignUpResponse, error)
|
|
|
|
// RefreshAuthTokenWithResponse request
|
|
RefreshAuthTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RefreshAuthTokenResponse, error)
|
|
|
|
// AttachTokenAuthWithBodyWithResponse request with any body
|
|
AttachTokenAuthWithBodyWithResponse(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachTokenAuthResponse, error)
|
|
|
|
AttachTokenAuthWithResponse(ctx context.Context, identityId string, body AttachTokenAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachTokenAuthResponse, error)
|
|
|
|
// CreateTokenAuthTokenWithBodyWithResponse request with any body
|
|
CreateTokenAuthTokenWithBodyWithResponse(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTokenAuthTokenResponse, error)
|
|
|
|
CreateTokenAuthTokenWithResponse(ctx context.Context, identityId string, body CreateTokenAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTokenAuthTokenResponse, error)
|
|
|
|
// CreateMachineIdentityWithBodyWithResponse request with any body
|
|
CreateMachineIdentityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMachineIdentityResponse, error)
|
|
|
|
CreateMachineIdentityWithResponse(ctx context.Context, body CreateMachineIdentityJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMachineIdentityResponse, error)
|
|
|
|
// CreateKubernetesPamResourceWithBodyWithResponse request with any body
|
|
CreateKubernetesPamResourceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateKubernetesPamResourceResponse, error)
|
|
|
|
CreateKubernetesPamResourceWithResponse(ctx context.Context, body CreateKubernetesPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateKubernetesPamResourceResponse, error)
|
|
|
|
// CreateRedisPamResourceWithBodyWithResponse request with any body
|
|
CreateRedisPamResourceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRedisPamResourceResponse, error)
|
|
|
|
CreateRedisPamResourceWithResponse(ctx context.Context, body CreateRedisPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRedisPamResourceResponse, error)
|
|
|
|
// CreateProjectWithBodyWithResponse request with any body
|
|
CreateProjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error)
|
|
|
|
CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error)
|
|
|
|
// GetRelaysWithResponse request
|
|
GetRelaysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRelaysResponse, error)
|
|
|
|
// ListGatewaysWithResponse request
|
|
ListGatewaysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListGatewaysResponse, error)
|
|
|
|
// SelectOrganizationV3WithBodyWithResponse request with any body
|
|
SelectOrganizationV3WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SelectOrganizationV3Response, error)
|
|
|
|
SelectOrganizationV3WithResponse(ctx context.Context, body SelectOrganizationV3JSONRequestBody, reqEditors ...RequestEditorFn) (*SelectOrganizationV3Response, error)
|
|
|
|
// ListSecretsV4WithResponse request
|
|
ListSecretsV4WithResponse(ctx context.Context, params *ListSecretsV4Params, reqEditors ...RequestEditorFn) (*ListSecretsV4Response, error)
|
|
|
|
// DeleteSecretV4WithBodyWithResponse request with any body
|
|
DeleteSecretV4WithBodyWithResponse(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecretV4Response, error)
|
|
|
|
DeleteSecretV4WithResponse(ctx context.Context, secretName string, body DeleteSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteSecretV4Response, error)
|
|
|
|
// GetSecretByNameV4WithResponse request
|
|
GetSecretByNameV4WithResponse(ctx context.Context, secretName string, params *GetSecretByNameV4Params, reqEditors ...RequestEditorFn) (*GetSecretByNameV4Response, error)
|
|
|
|
// UpdateSecretV4WithBodyWithResponse request with any body
|
|
UpdateSecretV4WithBodyWithResponse(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecretV4Response, error)
|
|
|
|
UpdateSecretV4WithResponse(ctx context.Context, secretName string, body UpdateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSecretV4Response, error)
|
|
|
|
// CreateSecretV4WithBodyWithResponse request with any body
|
|
CreateSecretV4WithBodyWithResponse(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretV4Response, error)
|
|
|
|
CreateSecretV4WithResponse(ctx context.Context, secretName string, body CreateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretV4Response, error)
|
|
}
|
|
|
|
type AdminSignUpResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Message string `json:"message"`
|
|
New string `json:"new"`
|
|
Organization struct {
|
|
AllowSecretSharingOutsideOrganization *bool `json:"allowSecretSharingOutsideOrganization"`
|
|
AuthEnforced *bool `json:"authEnforced"`
|
|
BlockDuplicateSecretSyncDestinations *bool `json:"blockDuplicateSecretSyncDestinations,omitempty"`
|
|
BypassOrgAuthEnabled *bool `json:"bypassOrgAuthEnabled,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
CustomerId *string `json:"customerId"`
|
|
DefaultMembershipRole *string `json:"defaultMembershipRole,omitempty"`
|
|
EnforceMfa *bool `json:"enforceMfa,omitempty"`
|
|
GoogleSsoAuthEnforced *bool `json:"googleSsoAuthEnforced,omitempty"`
|
|
GoogleSsoAuthLastUsed *time.Time `json:"googleSsoAuthLastUsed"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
KmsDefaultKeyId *openapi_types.UUID `json:"kmsDefaultKeyId"`
|
|
KmsEncryptedDataKey interface{} `json:"kmsEncryptedDataKey"`
|
|
KmsProductEnabled *bool `json:"kmsProductEnabled"`
|
|
MaxSharedSecretLifetime *float32 `json:"maxSharedSecretLifetime"`
|
|
MaxSharedSecretViewLimit *float32 `json:"maxSharedSecretViewLimit"`
|
|
Name string `json:"name"`
|
|
ParentOrgId *openapi_types.UUID `json:"parentOrgId"`
|
|
PkiProductEnabled *bool `json:"pkiProductEnabled"`
|
|
PrivilegeUpgradeInitiatedAt *time.Time `json:"privilegeUpgradeInitiatedAt"`
|
|
PrivilegeUpgradeInitiatedByUsername *string `json:"privilegeUpgradeInitiatedByUsername"`
|
|
RootOrgId *openapi_types.UUID `json:"rootOrgId"`
|
|
ScannerProductEnabled *bool `json:"scannerProductEnabled"`
|
|
ScimEnabled *bool `json:"scimEnabled"`
|
|
SecretShareBrandConfig interface{} `json:"secretShareBrandConfig"`
|
|
SecretsProductEnabled *bool `json:"secretsProductEnabled"`
|
|
SelectedMfaMethod *string `json:"selectedMfaMethod"`
|
|
ShareSecretsProductEnabled *bool `json:"shareSecretsProductEnabled"`
|
|
ShouldUseNewPrivilegeSystem *bool `json:"shouldUseNewPrivilegeSystem,omitempty"`
|
|
Slug string `json:"slug"`
|
|
SshProductEnabled *bool `json:"sshProductEnabled"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
UserTokenExpiration *string `json:"userTokenExpiration"`
|
|
} `json:"organization"`
|
|
Token string `json:"token"`
|
|
User struct {
|
|
AuthMethods *[]string `json:"authMethods"`
|
|
ConsecutiveFailedMfaAttempts *float32 `json:"consecutiveFailedMfaAttempts"`
|
|
ConsecutiveFailedPasswordAttempts *float32 `json:"consecutiveFailedPasswordAttempts"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Devices interface{} `json:"devices"`
|
|
Email *string `json:"email"`
|
|
FirstName *string `json:"firstName"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IsAccepted *bool `json:"isAccepted"`
|
|
IsEmailVerified *bool `json:"isEmailVerified"`
|
|
IsGhost *bool `json:"isGhost,omitempty"`
|
|
IsLocked *bool `json:"isLocked"`
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
LastName *string `json:"lastName"`
|
|
MfaMethods *[]string `json:"mfaMethods"`
|
|
SelectedMfaMethod *string `json:"selectedMfaMethod"`
|
|
SuperAdmin *bool `json:"superAdmin"`
|
|
TemporaryLockDateEnd *time.Time `json:"temporaryLockDateEnd"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Username string `json:"username"`
|
|
} `json:"user"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type AdminSignUp400StatusCode float32
|
|
type AdminSignUp401StatusCode float32
|
|
type AdminSignUp403StatusCode float32
|
|
type AdminSignUp404StatusCode float32
|
|
type AdminSignUp422StatusCode float32
|
|
type AdminSignUp500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r AdminSignUpResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r AdminSignUpResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type RefreshAuthTokenResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
OrganizationId *string `json:"organizationId,omitempty"`
|
|
SubOrganizationId *string `json:"subOrganizationId,omitempty"`
|
|
Token string `json:"token"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type RefreshAuthToken400StatusCode float32
|
|
type RefreshAuthToken401StatusCode float32
|
|
type RefreshAuthToken403StatusCode float32
|
|
type RefreshAuthToken404StatusCode float32
|
|
type RefreshAuthToken422StatusCode float32
|
|
type RefreshAuthToken500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r RefreshAuthTokenResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r RefreshAuthTokenResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type AttachTokenAuthResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
IdentityTokenAuth struct {
|
|
AccessTokenMaxTTL *float32 `json:"accessTokenMaxTTL,omitempty"`
|
|
AccessTokenNumUsesLimit *float32 `json:"accessTokenNumUsesLimit,omitempty"`
|
|
AccessTokenPeriod *float32 `json:"accessTokenPeriod,omitempty"`
|
|
AccessTokenTTL *float32 `json:"accessTokenTTL,omitempty"`
|
|
AccessTokenTrustedIps interface{} `json:"accessTokenTrustedIps,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IdentityId openapi_types.UUID `json:"identityId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"identityTokenAuth"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type AttachTokenAuth400StatusCode float32
|
|
type AttachTokenAuth401StatusCode float32
|
|
type AttachTokenAuth403StatusCode float32
|
|
type AttachTokenAuth404StatusCode float32
|
|
type AttachTokenAuth422StatusCode float32
|
|
type AttachTokenAuth500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r AttachTokenAuthResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r AttachTokenAuthResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CreateTokenAuthTokenResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
AccessToken string `json:"accessToken"`
|
|
AccessTokenMaxTTL float32 `json:"accessTokenMaxTTL"`
|
|
ExpiresIn float32 `json:"expiresIn"`
|
|
TokenData struct {
|
|
AccessTokenLastRenewedAt *time.Time `json:"accessTokenLastRenewedAt"`
|
|
AccessTokenLastUsedAt *time.Time `json:"accessTokenLastUsedAt"`
|
|
AccessTokenMaxTTL *float32 `json:"accessTokenMaxTTL,omitempty"`
|
|
AccessTokenNumUses *float32 `json:"accessTokenNumUses,omitempty"`
|
|
AccessTokenNumUsesLimit *float32 `json:"accessTokenNumUsesLimit,omitempty"`
|
|
AccessTokenPeriod *float32 `json:"accessTokenPeriod,omitempty"`
|
|
AccessTokenTTL *float32 `json:"accessTokenTTL,omitempty"`
|
|
AuthMethod string `json:"authMethod"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Id string `json:"id"`
|
|
IdentityId openapi_types.UUID `json:"identityId"`
|
|
IdentityUAClientSecretId *string `json:"identityUAClientSecretId"`
|
|
IsAccessTokenRevoked *bool `json:"isAccessTokenRevoked,omitempty"`
|
|
Name *string `json:"name"`
|
|
SubOrganizationId *openapi_types.UUID `json:"subOrganizationId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"tokenData"`
|
|
TokenType CreateTokenAuthToken200TokenType `json:"tokenType"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type CreateTokenAuthToken200TokenType string
|
|
type CreateTokenAuthToken400StatusCode float32
|
|
type CreateTokenAuthToken401StatusCode float32
|
|
type CreateTokenAuthToken403StatusCode float32
|
|
type CreateTokenAuthToken404StatusCode float32
|
|
type CreateTokenAuthToken422StatusCode float32
|
|
type CreateTokenAuthToken500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r CreateTokenAuthTokenResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r CreateTokenAuthTokenResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CreateMachineIdentityResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Identity struct {
|
|
AuthMethod *string `json:"authMethod"`
|
|
AuthMethods []string `json:"authMethods"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
HasDeleteProtection *bool `json:"hasDeleteProtection,omitempty"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Metadata []struct {
|
|
Id string `json:"id"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
} `json:"metadata"`
|
|
Name string `json:"name"`
|
|
OrgId openapi_types.UUID `json:"orgId"`
|
|
ProjectId *string `json:"projectId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"identity"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type CreateMachineIdentity400StatusCode float32
|
|
type CreateMachineIdentity401StatusCode float32
|
|
type CreateMachineIdentity403StatusCode float32
|
|
type CreateMachineIdentity404StatusCode float32
|
|
type CreateMachineIdentity422StatusCode float32
|
|
type CreateMachineIdentity500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r CreateMachineIdentityResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r CreateMachineIdentityResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CreateKubernetesPamResourceResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Resource struct {
|
|
ConnectionDetails struct {
|
|
SslCertificate *string `json:"sslCertificate,omitempty"`
|
|
SslRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
Url string `json:"url"`
|
|
} `json:"connectionDetails"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
EncryptedResourceMetadata interface{} `json:"encryptedResourceMetadata"`
|
|
GatewayId *openapi_types.UUID `json:"gatewayId"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
ProjectId string `json:"projectId"`
|
|
ResourceType CreateKubernetesPamResource200ResourceResourceType `json:"resourceType"`
|
|
RotationAccountCredentials *CreateKubernetesPamResource_200_Resource_RotationAccountCredentials `json:"rotationAccountCredentials"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"resource"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type CreateKubernetesPamResource200ResourceResourceType string
|
|
type CreateKubernetesPamResource200ResourceRotationAccountCredentials0 struct {
|
|
AuthMethod CreateKubernetesPamResource200ResourceRotationAccountCredentials0AuthMethod `json:"authMethod"`
|
|
}
|
|
type CreateKubernetesPamResource200ResourceRotationAccountCredentials0AuthMethod string
|
|
type CreateKubernetesPamResource_200_Resource_RotationAccountCredentials struct {
|
|
union json.RawMessage
|
|
}
|
|
type CreateKubernetesPamResource400StatusCode float32
|
|
type CreateKubernetesPamResource401StatusCode float32
|
|
type CreateKubernetesPamResource403StatusCode float32
|
|
type CreateKubernetesPamResource404StatusCode float32
|
|
type CreateKubernetesPamResource422StatusCode float32
|
|
type CreateKubernetesPamResource500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r CreateKubernetesPamResourceResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r CreateKubernetesPamResourceResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CreateRedisPamResourceResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Resource struct {
|
|
ConnectionDetails struct {
|
|
Host string `json:"host"`
|
|
Port float32 `json:"port"`
|
|
SslCertificate *string `json:"sslCertificate,omitempty"`
|
|
SslEnabled bool `json:"sslEnabled"`
|
|
SslRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
} `json:"connectionDetails"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
EncryptedResourceMetadata interface{} `json:"encryptedResourceMetadata"`
|
|
GatewayId *openapi_types.UUID `json:"gatewayId"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
ProjectId string `json:"projectId"`
|
|
ResourceType CreateRedisPamResource200ResourceResourceType `json:"resourceType"`
|
|
RotationAccountCredentials *struct {
|
|
Username *string `json:"username,omitempty"`
|
|
} `json:"rotationAccountCredentials"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"resource"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type CreateRedisPamResource200ResourceResourceType string
|
|
type CreateRedisPamResource400StatusCode float32
|
|
type CreateRedisPamResource401StatusCode float32
|
|
type CreateRedisPamResource403StatusCode float32
|
|
type CreateRedisPamResource404StatusCode float32
|
|
type CreateRedisPamResource422StatusCode float32
|
|
type CreateRedisPamResource500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r CreateRedisPamResourceResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r CreateRedisPamResourceResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CreateProjectResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Project struct {
|
|
UnderscoreId string `json:"_id"`
|
|
AuditLogsRetentionDays *float32 `json:"auditLogsRetentionDays"`
|
|
AutoCapitalization *bool `json:"autoCapitalization"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
DefaultProduct *string `json:"defaultProduct"`
|
|
Description *string `json:"description"`
|
|
Environments []struct {
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
} `json:"environments"`
|
|
HasDeleteProtection *bool `json:"hasDeleteProtection"`
|
|
Id string `json:"id"`
|
|
KmsCertificateKeyId *openapi_types.UUID `json:"kmsCertificateKeyId"`
|
|
Name string `json:"name"`
|
|
OrgId openapi_types.UUID `json:"orgId"`
|
|
PitVersionLimit *float32 `json:"pitVersionLimit,omitempty"`
|
|
SecretDetectionIgnoreValues *[]string `json:"secretDetectionIgnoreValues"`
|
|
SecretSharing *bool `json:"secretSharing,omitempty"`
|
|
ShowSnapshotsLegacy *bool `json:"showSnapshotsLegacy,omitempty"`
|
|
Slug string `json:"slug"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
UpgradeStatus *string `json:"upgradeStatus"`
|
|
Version *float32 `json:"version,omitempty"`
|
|
} `json:"project"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type CreateProject400StatusCode float32
|
|
type CreateProject401StatusCode float32
|
|
type CreateProject403StatusCode float32
|
|
type CreateProject404StatusCode float32
|
|
type CreateProject422StatusCode float32
|
|
type CreateProject500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r CreateProjectResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r CreateProjectResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetRelaysResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
HealthAlertedAt *time.Time `json:"healthAlertedAt"`
|
|
Heartbeat *time.Time `json:"heartbeat"`
|
|
Host string `json:"host"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IdentityId *openapi_types.UUID `json:"identityId"`
|
|
Name string `json:"name"`
|
|
OrgId *openapi_types.UUID `json:"orgId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type GetRelays400StatusCode float32
|
|
type GetRelays401StatusCode float32
|
|
type GetRelays403StatusCode float32
|
|
type GetRelays404StatusCode float32
|
|
type GetRelays422StatusCode float32
|
|
type GetRelays500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetRelaysResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetRelaysResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type ListGatewaysResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Heartbeat *time.Time `json:"heartbeat"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Identity struct {
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
} `json:"identity"`
|
|
IdentityId openapi_types.UUID `json:"identityId"`
|
|
Name string `json:"name"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type ListGateways400StatusCode float32
|
|
type ListGateways401StatusCode float32
|
|
type ListGateways403StatusCode float32
|
|
type ListGateways404StatusCode float32
|
|
type ListGateways422StatusCode float32
|
|
type ListGateways500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r ListGatewaysResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r ListGatewaysResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type SelectOrganizationV3Response struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
IsMfaEnabled bool `json:"isMfaEnabled"`
|
|
MfaMethod *string `json:"mfaMethod,omitempty"`
|
|
Token string `json:"token"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type SelectOrganizationV3400StatusCode float32
|
|
type SelectOrganizationV3401StatusCode float32
|
|
type SelectOrganizationV3403StatusCode float32
|
|
type SelectOrganizationV3404StatusCode float32
|
|
type SelectOrganizationV3422StatusCode float32
|
|
type SelectOrganizationV3500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r SelectOrganizationV3Response) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r SelectOrganizationV3Response) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type ListSecretsV4Response struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Imports *[]struct {
|
|
Environment string `json:"environment"`
|
|
FolderId *string `json:"folderId,omitempty"`
|
|
SecretPath string `json:"secretPath"`
|
|
Secrets []struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Type string `json:"type"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secrets"`
|
|
} `json:"imports,omitempty"`
|
|
Secrets []struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
SecretPath *string `json:"secretPath,omitempty"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Tags *[]struct {
|
|
Color *string `json:"color"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
} `json:"tags,omitempty"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secrets"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type ListSecretsV4400StatusCode float32
|
|
type ListSecretsV4401StatusCode float32
|
|
type ListSecretsV4403StatusCode float32
|
|
type ListSecretsV4404StatusCode float32
|
|
type ListSecretsV4422StatusCode float32
|
|
type ListSecretsV4500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r ListSecretsV4Response) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r ListSecretsV4Response) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type DeleteSecretV4Response struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
union json.RawMessage
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type DeleteSecretV42000 struct {
|
|
Secret struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secret"`
|
|
}
|
|
type DeleteSecretV42001 struct {
|
|
Approval struct {
|
|
BypassReason *string `json:"bypassReason"`
|
|
CommitterUserId *openapi_types.UUID `json:"committerUserId"`
|
|
Conflicts interface{} `json:"conflicts"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
FolderId openapi_types.UUID `json:"folderId"`
|
|
HasMerged *bool `json:"hasMerged,omitempty"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IsReplicated *bool `json:"isReplicated"`
|
|
PolicyId openapi_types.UUID `json:"policyId"`
|
|
Slug string `json:"slug"`
|
|
Status *string `json:"status,omitempty"`
|
|
StatusChangedByUserId *openapi_types.UUID `json:"statusChangedByUserId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"approval"`
|
|
}
|
|
type DeleteSecretV4400StatusCode float32
|
|
type DeleteSecretV4401StatusCode float32
|
|
type DeleteSecretV4403StatusCode float32
|
|
type DeleteSecretV4404StatusCode float32
|
|
type DeleteSecretV4422StatusCode float32
|
|
type DeleteSecretV4500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r DeleteSecretV4Response) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r DeleteSecretV4Response) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetSecretByNameV4Response struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Secret struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
SecretPath string `json:"secretPath"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Tags *[]struct {
|
|
Color *string `json:"color"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
} `json:"tags,omitempty"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secret"`
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type GetSecretByNameV4400StatusCode float32
|
|
type GetSecretByNameV4401StatusCode float32
|
|
type GetSecretByNameV4403StatusCode float32
|
|
type GetSecretByNameV4404StatusCode float32
|
|
type GetSecretByNameV4422StatusCode float32
|
|
type GetSecretByNameV4500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetSecretByNameV4Response) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetSecretByNameV4Response) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type UpdateSecretV4Response struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
union json.RawMessage
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type UpdateSecretV42000 struct {
|
|
Secret struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secret"`
|
|
}
|
|
type UpdateSecretV42001 struct {
|
|
Approval struct {
|
|
BypassReason *string `json:"bypassReason"`
|
|
CommitterUserId *openapi_types.UUID `json:"committerUserId"`
|
|
Conflicts interface{} `json:"conflicts"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
FolderId openapi_types.UUID `json:"folderId"`
|
|
HasMerged *bool `json:"hasMerged,omitempty"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IsReplicated *bool `json:"isReplicated"`
|
|
PolicyId openapi_types.UUID `json:"policyId"`
|
|
Slug string `json:"slug"`
|
|
Status *string `json:"status,omitempty"`
|
|
StatusChangedByUserId *openapi_types.UUID `json:"statusChangedByUserId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"approval"`
|
|
}
|
|
type UpdateSecretV4400StatusCode float32
|
|
type UpdateSecretV4401StatusCode float32
|
|
type UpdateSecretV4403StatusCode float32
|
|
type UpdateSecretV4404StatusCode float32
|
|
type UpdateSecretV4422StatusCode float32
|
|
type UpdateSecretV4500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r UpdateSecretV4Response) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r UpdateSecretV4Response) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type CreateSecretV4Response struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
union json.RawMessage
|
|
}
|
|
JSON400 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4400StatusCode `json:"statusCode"`
|
|
}
|
|
JSON401 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4401StatusCode `json:"statusCode"`
|
|
}
|
|
JSON403 *struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4403StatusCode `json:"statusCode"`
|
|
}
|
|
JSON404 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4404StatusCode `json:"statusCode"`
|
|
}
|
|
JSON422 *struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4422StatusCode `json:"statusCode"`
|
|
}
|
|
JSON500 *struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4500StatusCode `json:"statusCode"`
|
|
}
|
|
}
|
|
type CreateSecretV42000 struct {
|
|
Secret struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secret"`
|
|
}
|
|
type CreateSecretV42001 struct {
|
|
Approval struct {
|
|
BypassReason *string `json:"bypassReason"`
|
|
CommitterUserId *openapi_types.UUID `json:"committerUserId"`
|
|
Conflicts interface{} `json:"conflicts"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
FolderId openapi_types.UUID `json:"folderId"`
|
|
HasMerged *bool `json:"hasMerged,omitempty"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IsReplicated *bool `json:"isReplicated"`
|
|
PolicyId openapi_types.UUID `json:"policyId"`
|
|
Slug string `json:"slug"`
|
|
Status *string `json:"status,omitempty"`
|
|
StatusChangedByUserId *openapi_types.UUID `json:"statusChangedByUserId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"approval"`
|
|
}
|
|
type CreateSecretV4400StatusCode float32
|
|
type CreateSecretV4401StatusCode float32
|
|
type CreateSecretV4403StatusCode float32
|
|
type CreateSecretV4404StatusCode float32
|
|
type CreateSecretV4422StatusCode float32
|
|
type CreateSecretV4500StatusCode float32
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r CreateSecretV4Response) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r CreateSecretV4Response) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// AdminSignUpWithBodyWithResponse request with arbitrary body returning *AdminSignUpResponse
|
|
func (c *ClientWithResponses) AdminSignUpWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AdminSignUpResponse, error) {
|
|
rsp, err := c.AdminSignUpWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseAdminSignUpResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) AdminSignUpWithResponse(ctx context.Context, body AdminSignUpJSONRequestBody, reqEditors ...RequestEditorFn) (*AdminSignUpResponse, error) {
|
|
rsp, err := c.AdminSignUp(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseAdminSignUpResponse(rsp)
|
|
}
|
|
|
|
// RefreshAuthTokenWithResponse request returning *RefreshAuthTokenResponse
|
|
func (c *ClientWithResponses) RefreshAuthTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RefreshAuthTokenResponse, error) {
|
|
rsp, err := c.RefreshAuthToken(ctx, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseRefreshAuthTokenResponse(rsp)
|
|
}
|
|
|
|
// AttachTokenAuthWithBodyWithResponse request with arbitrary body returning *AttachTokenAuthResponse
|
|
func (c *ClientWithResponses) AttachTokenAuthWithBodyWithResponse(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AttachTokenAuthResponse, error) {
|
|
rsp, err := c.AttachTokenAuthWithBody(ctx, identityId, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseAttachTokenAuthResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) AttachTokenAuthWithResponse(ctx context.Context, identityId string, body AttachTokenAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*AttachTokenAuthResponse, error) {
|
|
rsp, err := c.AttachTokenAuth(ctx, identityId, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseAttachTokenAuthResponse(rsp)
|
|
}
|
|
|
|
// CreateTokenAuthTokenWithBodyWithResponse request with arbitrary body returning *CreateTokenAuthTokenResponse
|
|
func (c *ClientWithResponses) CreateTokenAuthTokenWithBodyWithResponse(ctx context.Context, identityId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTokenAuthTokenResponse, error) {
|
|
rsp, err := c.CreateTokenAuthTokenWithBody(ctx, identityId, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateTokenAuthTokenResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) CreateTokenAuthTokenWithResponse(ctx context.Context, identityId string, body CreateTokenAuthTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTokenAuthTokenResponse, error) {
|
|
rsp, err := c.CreateTokenAuthToken(ctx, identityId, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateTokenAuthTokenResponse(rsp)
|
|
}
|
|
|
|
// CreateMachineIdentityWithBodyWithResponse request with arbitrary body returning *CreateMachineIdentityResponse
|
|
func (c *ClientWithResponses) CreateMachineIdentityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMachineIdentityResponse, error) {
|
|
rsp, err := c.CreateMachineIdentityWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateMachineIdentityResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) CreateMachineIdentityWithResponse(ctx context.Context, body CreateMachineIdentityJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMachineIdentityResponse, error) {
|
|
rsp, err := c.CreateMachineIdentity(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateMachineIdentityResponse(rsp)
|
|
}
|
|
|
|
// CreateKubernetesPamResourceWithBodyWithResponse request with arbitrary body returning *CreateKubernetesPamResourceResponse
|
|
func (c *ClientWithResponses) CreateKubernetesPamResourceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateKubernetesPamResourceResponse, error) {
|
|
rsp, err := c.CreateKubernetesPamResourceWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateKubernetesPamResourceResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) CreateKubernetesPamResourceWithResponse(ctx context.Context, body CreateKubernetesPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateKubernetesPamResourceResponse, error) {
|
|
rsp, err := c.CreateKubernetesPamResource(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateKubernetesPamResourceResponse(rsp)
|
|
}
|
|
|
|
// CreateRedisPamResourceWithBodyWithResponse request with arbitrary body returning *CreateRedisPamResourceResponse
|
|
func (c *ClientWithResponses) CreateRedisPamResourceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRedisPamResourceResponse, error) {
|
|
rsp, err := c.CreateRedisPamResourceWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateRedisPamResourceResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) CreateRedisPamResourceWithResponse(ctx context.Context, body CreateRedisPamResourceJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRedisPamResourceResponse, error) {
|
|
rsp, err := c.CreateRedisPamResource(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateRedisPamResourceResponse(rsp)
|
|
}
|
|
|
|
// CreateProjectWithBodyWithResponse request with arbitrary body returning *CreateProjectResponse
|
|
func (c *ClientWithResponses) CreateProjectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) {
|
|
rsp, err := c.CreateProjectWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateProjectResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) CreateProjectWithResponse(ctx context.Context, body CreateProjectJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateProjectResponse, error) {
|
|
rsp, err := c.CreateProject(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateProjectResponse(rsp)
|
|
}
|
|
|
|
// GetRelaysWithResponse request returning *GetRelaysResponse
|
|
func (c *ClientWithResponses) GetRelaysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRelaysResponse, error) {
|
|
rsp, err := c.GetRelays(ctx, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetRelaysResponse(rsp)
|
|
}
|
|
|
|
// ListGatewaysWithResponse request returning *ListGatewaysResponse
|
|
func (c *ClientWithResponses) ListGatewaysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListGatewaysResponse, error) {
|
|
rsp, err := c.ListGateways(ctx, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseListGatewaysResponse(rsp)
|
|
}
|
|
|
|
// SelectOrganizationV3WithBodyWithResponse request with arbitrary body returning *SelectOrganizationV3Response
|
|
func (c *ClientWithResponses) SelectOrganizationV3WithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SelectOrganizationV3Response, error) {
|
|
rsp, err := c.SelectOrganizationV3WithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseSelectOrganizationV3Response(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) SelectOrganizationV3WithResponse(ctx context.Context, body SelectOrganizationV3JSONRequestBody, reqEditors ...RequestEditorFn) (*SelectOrganizationV3Response, error) {
|
|
rsp, err := c.SelectOrganizationV3(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseSelectOrganizationV3Response(rsp)
|
|
}
|
|
|
|
// ListSecretsV4WithResponse request returning *ListSecretsV4Response
|
|
func (c *ClientWithResponses) ListSecretsV4WithResponse(ctx context.Context, params *ListSecretsV4Params, reqEditors ...RequestEditorFn) (*ListSecretsV4Response, error) {
|
|
rsp, err := c.ListSecretsV4(ctx, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseListSecretsV4Response(rsp)
|
|
}
|
|
|
|
// DeleteSecretV4WithBodyWithResponse request with arbitrary body returning *DeleteSecretV4Response
|
|
func (c *ClientWithResponses) DeleteSecretV4WithBodyWithResponse(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteSecretV4Response, error) {
|
|
rsp, err := c.DeleteSecretV4WithBody(ctx, secretName, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteSecretV4Response(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) DeleteSecretV4WithResponse(ctx context.Context, secretName string, body DeleteSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteSecretV4Response, error) {
|
|
rsp, err := c.DeleteSecretV4(ctx, secretName, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteSecretV4Response(rsp)
|
|
}
|
|
|
|
// GetSecretByNameV4WithResponse request returning *GetSecretByNameV4Response
|
|
func (c *ClientWithResponses) GetSecretByNameV4WithResponse(ctx context.Context, secretName string, params *GetSecretByNameV4Params, reqEditors ...RequestEditorFn) (*GetSecretByNameV4Response, error) {
|
|
rsp, err := c.GetSecretByNameV4(ctx, secretName, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetSecretByNameV4Response(rsp)
|
|
}
|
|
|
|
// UpdateSecretV4WithBodyWithResponse request with arbitrary body returning *UpdateSecretV4Response
|
|
func (c *ClientWithResponses) UpdateSecretV4WithBodyWithResponse(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSecretV4Response, error) {
|
|
rsp, err := c.UpdateSecretV4WithBody(ctx, secretName, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseUpdateSecretV4Response(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) UpdateSecretV4WithResponse(ctx context.Context, secretName string, body UpdateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSecretV4Response, error) {
|
|
rsp, err := c.UpdateSecretV4(ctx, secretName, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseUpdateSecretV4Response(rsp)
|
|
}
|
|
|
|
// CreateSecretV4WithBodyWithResponse request with arbitrary body returning *CreateSecretV4Response
|
|
func (c *ClientWithResponses) CreateSecretV4WithBodyWithResponse(ctx context.Context, secretName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSecretV4Response, error) {
|
|
rsp, err := c.CreateSecretV4WithBody(ctx, secretName, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateSecretV4Response(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) CreateSecretV4WithResponse(ctx context.Context, secretName string, body CreateSecretV4JSONRequestBody, reqEditors ...RequestEditorFn) (*CreateSecretV4Response, error) {
|
|
rsp, err := c.CreateSecretV4(ctx, secretName, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseCreateSecretV4Response(rsp)
|
|
}
|
|
|
|
// ParseAdminSignUpResponse parses an HTTP response from a AdminSignUpWithResponse call
|
|
func ParseAdminSignUpResponse(rsp *http.Response) (*AdminSignUpResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &AdminSignUpResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Message string `json:"message"`
|
|
New string `json:"new"`
|
|
Organization struct {
|
|
AllowSecretSharingOutsideOrganization *bool `json:"allowSecretSharingOutsideOrganization"`
|
|
AuthEnforced *bool `json:"authEnforced"`
|
|
BlockDuplicateSecretSyncDestinations *bool `json:"blockDuplicateSecretSyncDestinations,omitempty"`
|
|
BypassOrgAuthEnabled *bool `json:"bypassOrgAuthEnabled,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
CustomerId *string `json:"customerId"`
|
|
DefaultMembershipRole *string `json:"defaultMembershipRole,omitempty"`
|
|
EnforceMfa *bool `json:"enforceMfa,omitempty"`
|
|
GoogleSsoAuthEnforced *bool `json:"googleSsoAuthEnforced,omitempty"`
|
|
GoogleSsoAuthLastUsed *time.Time `json:"googleSsoAuthLastUsed"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
KmsDefaultKeyId *openapi_types.UUID `json:"kmsDefaultKeyId"`
|
|
KmsEncryptedDataKey interface{} `json:"kmsEncryptedDataKey"`
|
|
KmsProductEnabled *bool `json:"kmsProductEnabled"`
|
|
MaxSharedSecretLifetime *float32 `json:"maxSharedSecretLifetime"`
|
|
MaxSharedSecretViewLimit *float32 `json:"maxSharedSecretViewLimit"`
|
|
Name string `json:"name"`
|
|
ParentOrgId *openapi_types.UUID `json:"parentOrgId"`
|
|
PkiProductEnabled *bool `json:"pkiProductEnabled"`
|
|
PrivilegeUpgradeInitiatedAt *time.Time `json:"privilegeUpgradeInitiatedAt"`
|
|
PrivilegeUpgradeInitiatedByUsername *string `json:"privilegeUpgradeInitiatedByUsername"`
|
|
RootOrgId *openapi_types.UUID `json:"rootOrgId"`
|
|
ScannerProductEnabled *bool `json:"scannerProductEnabled"`
|
|
ScimEnabled *bool `json:"scimEnabled"`
|
|
SecretShareBrandConfig interface{} `json:"secretShareBrandConfig"`
|
|
SecretsProductEnabled *bool `json:"secretsProductEnabled"`
|
|
SelectedMfaMethod *string `json:"selectedMfaMethod"`
|
|
ShareSecretsProductEnabled *bool `json:"shareSecretsProductEnabled"`
|
|
ShouldUseNewPrivilegeSystem *bool `json:"shouldUseNewPrivilegeSystem,omitempty"`
|
|
Slug string `json:"slug"`
|
|
SshProductEnabled *bool `json:"sshProductEnabled"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
UserTokenExpiration *string `json:"userTokenExpiration"`
|
|
} `json:"organization"`
|
|
Token string `json:"token"`
|
|
User struct {
|
|
AuthMethods *[]string `json:"authMethods"`
|
|
ConsecutiveFailedMfaAttempts *float32 `json:"consecutiveFailedMfaAttempts"`
|
|
ConsecutiveFailedPasswordAttempts *float32 `json:"consecutiveFailedPasswordAttempts"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Devices interface{} `json:"devices"`
|
|
Email *string `json:"email"`
|
|
FirstName *string `json:"firstName"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IsAccepted *bool `json:"isAccepted"`
|
|
IsEmailVerified *bool `json:"isEmailVerified"`
|
|
IsGhost *bool `json:"isGhost,omitempty"`
|
|
IsLocked *bool `json:"isLocked"`
|
|
IsMfaEnabled *bool `json:"isMfaEnabled"`
|
|
LastName *string `json:"lastName"`
|
|
MfaMethods *[]string `json:"mfaMethods"`
|
|
SelectedMfaMethod *string `json:"selectedMfaMethod"`
|
|
SuperAdmin *bool `json:"superAdmin"`
|
|
TemporaryLockDateEnd *time.Time `json:"temporaryLockDateEnd"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Username string `json:"username"`
|
|
} `json:"user"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AdminSignUp500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseRefreshAuthTokenResponse parses an HTTP response from a RefreshAuthTokenWithResponse call
|
|
func ParseRefreshAuthTokenResponse(rsp *http.Response) (*RefreshAuthTokenResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &RefreshAuthTokenResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
OrganizationId *string `json:"organizationId,omitempty"`
|
|
SubOrganizationId *string `json:"subOrganizationId,omitempty"`
|
|
Token string `json:"token"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode RefreshAuthToken500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseAttachTokenAuthResponse parses an HTTP response from a AttachTokenAuthWithResponse call
|
|
func ParseAttachTokenAuthResponse(rsp *http.Response) (*AttachTokenAuthResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &AttachTokenAuthResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
IdentityTokenAuth struct {
|
|
AccessTokenMaxTTL *float32 `json:"accessTokenMaxTTL,omitempty"`
|
|
AccessTokenNumUsesLimit *float32 `json:"accessTokenNumUsesLimit,omitempty"`
|
|
AccessTokenPeriod *float32 `json:"accessTokenPeriod,omitempty"`
|
|
AccessTokenTTL *float32 `json:"accessTokenTTL,omitempty"`
|
|
AccessTokenTrustedIps interface{} `json:"accessTokenTrustedIps,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IdentityId openapi_types.UUID `json:"identityId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"identityTokenAuth"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode AttachTokenAuth500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseCreateTokenAuthTokenResponse parses an HTTP response from a CreateTokenAuthTokenWithResponse call
|
|
func ParseCreateTokenAuthTokenResponse(rsp *http.Response) (*CreateTokenAuthTokenResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &CreateTokenAuthTokenResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
AccessToken string `json:"accessToken"`
|
|
AccessTokenMaxTTL float32 `json:"accessTokenMaxTTL"`
|
|
ExpiresIn float32 `json:"expiresIn"`
|
|
TokenData struct {
|
|
AccessTokenLastRenewedAt *time.Time `json:"accessTokenLastRenewedAt"`
|
|
AccessTokenLastUsedAt *time.Time `json:"accessTokenLastUsedAt"`
|
|
AccessTokenMaxTTL *float32 `json:"accessTokenMaxTTL,omitempty"`
|
|
AccessTokenNumUses *float32 `json:"accessTokenNumUses,omitempty"`
|
|
AccessTokenNumUsesLimit *float32 `json:"accessTokenNumUsesLimit,omitempty"`
|
|
AccessTokenPeriod *float32 `json:"accessTokenPeriod,omitempty"`
|
|
AccessTokenTTL *float32 `json:"accessTokenTTL,omitempty"`
|
|
AuthMethod string `json:"authMethod"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Id string `json:"id"`
|
|
IdentityId openapi_types.UUID `json:"identityId"`
|
|
IdentityUAClientSecretId *string `json:"identityUAClientSecretId"`
|
|
IsAccessTokenRevoked *bool `json:"isAccessTokenRevoked,omitempty"`
|
|
Name *string `json:"name"`
|
|
SubOrganizationId *openapi_types.UUID `json:"subOrganizationId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"tokenData"`
|
|
TokenType CreateTokenAuthToken200TokenType `json:"tokenType"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateTokenAuthToken500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseCreateMachineIdentityResponse parses an HTTP response from a CreateMachineIdentityWithResponse call
|
|
func ParseCreateMachineIdentityResponse(rsp *http.Response) (*CreateMachineIdentityResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &CreateMachineIdentityResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Identity struct {
|
|
AuthMethod *string `json:"authMethod"`
|
|
AuthMethods []string `json:"authMethods"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
HasDeleteProtection *bool `json:"hasDeleteProtection,omitempty"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Metadata []struct {
|
|
Id string `json:"id"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
} `json:"metadata"`
|
|
Name string `json:"name"`
|
|
OrgId openapi_types.UUID `json:"orgId"`
|
|
ProjectId *string `json:"projectId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"identity"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateMachineIdentity500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseCreateKubernetesPamResourceResponse parses an HTTP response from a CreateKubernetesPamResourceWithResponse call
|
|
func ParseCreateKubernetesPamResourceResponse(rsp *http.Response) (*CreateKubernetesPamResourceResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &CreateKubernetesPamResourceResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Resource struct {
|
|
ConnectionDetails struct {
|
|
SslCertificate *string `json:"sslCertificate,omitempty"`
|
|
SslRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
Url string `json:"url"`
|
|
} `json:"connectionDetails"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
EncryptedResourceMetadata interface{} `json:"encryptedResourceMetadata"`
|
|
GatewayId *openapi_types.UUID `json:"gatewayId"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
ProjectId string `json:"projectId"`
|
|
ResourceType CreateKubernetesPamResource200ResourceResourceType `json:"resourceType"`
|
|
RotationAccountCredentials *CreateKubernetesPamResource_200_Resource_RotationAccountCredentials `json:"rotationAccountCredentials"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"resource"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateKubernetesPamResource500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseCreateRedisPamResourceResponse parses an HTTP response from a CreateRedisPamResourceWithResponse call
|
|
func ParseCreateRedisPamResourceResponse(rsp *http.Response) (*CreateRedisPamResourceResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &CreateRedisPamResourceResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Resource struct {
|
|
ConnectionDetails struct {
|
|
Host string `json:"host"`
|
|
Port float32 `json:"port"`
|
|
SslCertificate *string `json:"sslCertificate,omitempty"`
|
|
SslEnabled bool `json:"sslEnabled"`
|
|
SslRejectUnauthorized bool `json:"sslRejectUnauthorized"`
|
|
} `json:"connectionDetails"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
EncryptedResourceMetadata interface{} `json:"encryptedResourceMetadata"`
|
|
GatewayId *openapi_types.UUID `json:"gatewayId"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
ProjectId string `json:"projectId"`
|
|
ResourceType CreateRedisPamResource200ResourceResourceType `json:"resourceType"`
|
|
RotationAccountCredentials *struct {
|
|
Username *string `json:"username,omitempty"`
|
|
} `json:"rotationAccountCredentials"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
} `json:"resource"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateRedisPamResource500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseCreateProjectResponse parses an HTTP response from a CreateProjectWithResponse call
|
|
func ParseCreateProjectResponse(rsp *http.Response) (*CreateProjectResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &CreateProjectResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Project struct {
|
|
UnderscoreId string `json:"_id"`
|
|
AuditLogsRetentionDays *float32 `json:"auditLogsRetentionDays"`
|
|
AutoCapitalization *bool `json:"autoCapitalization"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
DefaultProduct *string `json:"defaultProduct"`
|
|
Description *string `json:"description"`
|
|
Environments []struct {
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
} `json:"environments"`
|
|
HasDeleteProtection *bool `json:"hasDeleteProtection"`
|
|
Id string `json:"id"`
|
|
KmsCertificateKeyId *openapi_types.UUID `json:"kmsCertificateKeyId"`
|
|
Name string `json:"name"`
|
|
OrgId openapi_types.UUID `json:"orgId"`
|
|
PitVersionLimit *float32 `json:"pitVersionLimit,omitempty"`
|
|
SecretDetectionIgnoreValues *[]string `json:"secretDetectionIgnoreValues"`
|
|
SecretSharing *bool `json:"secretSharing,omitempty"`
|
|
ShowSnapshotsLegacy *bool `json:"showSnapshotsLegacy,omitempty"`
|
|
Slug string `json:"slug"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
UpgradeStatus *string `json:"upgradeStatus"`
|
|
Version *float32 `json:"version,omitempty"`
|
|
} `json:"project"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateProject500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetRelaysResponse parses an HTTP response from a GetRelaysWithResponse call
|
|
func ParseGetRelaysResponse(rsp *http.Response) (*GetRelaysResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetRelaysResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
HealthAlertedAt *time.Time `json:"healthAlertedAt"`
|
|
Heartbeat *time.Time `json:"heartbeat"`
|
|
Host string `json:"host"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
IdentityId *openapi_types.UUID `json:"identityId"`
|
|
Name string `json:"name"`
|
|
OrgId *openapi_types.UUID `json:"orgId"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetRelays500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseListGatewaysResponse parses an HTTP response from a ListGatewaysWithResponse call
|
|
func ParseListGatewaysResponse(rsp *http.Response) (*ListGatewaysResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &ListGatewaysResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Heartbeat *time.Time `json:"heartbeat"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Identity struct {
|
|
Id string `json:"id"`
|
|
Name string `json:"name"`
|
|
} `json:"identity"`
|
|
IdentityId openapi_types.UUID `json:"identityId"`
|
|
Name string `json:"name"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListGateways500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseSelectOrganizationV3Response parses an HTTP response from a SelectOrganizationV3WithResponse call
|
|
func ParseSelectOrganizationV3Response(rsp *http.Response) (*SelectOrganizationV3Response, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &SelectOrganizationV3Response{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
IsMfaEnabled bool `json:"isMfaEnabled"`
|
|
MfaMethod *string `json:"mfaMethod,omitempty"`
|
|
Token string `json:"token"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode SelectOrganizationV3500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseListSecretsV4Response parses an HTTP response from a ListSecretsV4WithResponse call
|
|
func ParseListSecretsV4Response(rsp *http.Response) (*ListSecretsV4Response, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &ListSecretsV4Response{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Imports *[]struct {
|
|
Environment string `json:"environment"`
|
|
FolderId *string `json:"folderId,omitempty"`
|
|
SecretPath string `json:"secretPath"`
|
|
Secrets []struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Type string `json:"type"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secrets"`
|
|
} `json:"imports,omitempty"`
|
|
Secrets []struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
SecretPath *string `json:"secretPath,omitempty"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Tags *[]struct {
|
|
Color *string `json:"color"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
} `json:"tags,omitempty"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secrets"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode ListSecretsV4500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseDeleteSecretV4Response parses an HTTP response from a DeleteSecretV4WithResponse call
|
|
func ParseDeleteSecretV4Response(rsp *http.Response) (*DeleteSecretV4Response, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &DeleteSecretV4Response{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
union json.RawMessage
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode DeleteSecretV4500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetSecretByNameV4Response parses an HTTP response from a GetSecretByNameV4WithResponse call
|
|
func ParseGetSecretByNameV4Response(rsp *http.Response) (*GetSecretByNameV4Response, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetSecretByNameV4Response{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Secret struct {
|
|
UnderscoreId string `json:"_id"`
|
|
Actor *struct {
|
|
ActorId *string `json:"actorId"`
|
|
ActorType *string `json:"actorType"`
|
|
GroupId *string `json:"groupId"`
|
|
MembershipId *string `json:"membershipId"`
|
|
Name *string `json:"name"`
|
|
} `json:"actor"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
Environment string `json:"environment"`
|
|
Id string `json:"id"`
|
|
IsRotatedSecret *bool `json:"isRotatedSecret,omitempty"`
|
|
RotationId *openapi_types.UUID `json:"rotationId"`
|
|
SecretComment string `json:"secretComment"`
|
|
SecretKey string `json:"secretKey"`
|
|
SecretMetadata *[]struct {
|
|
Key string `json:"key"`
|
|
Value *string `json:"value,omitempty"`
|
|
} `json:"secretMetadata,omitempty"`
|
|
SecretPath string `json:"secretPath"`
|
|
SecretReminderNote *string `json:"secretReminderNote"`
|
|
SecretReminderRepeatDays *float32 `json:"secretReminderRepeatDays"`
|
|
SecretValue string `json:"secretValue"`
|
|
SecretValueHidden bool `json:"secretValueHidden"`
|
|
SkipMultilineEncoding *bool `json:"skipMultilineEncoding"`
|
|
Tags *[]struct {
|
|
Color *string `json:"color"`
|
|
Id openapi_types.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Slug string `json:"slug"`
|
|
} `json:"tags,omitempty"`
|
|
Type string `json:"type"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
Version float32 `json:"version"`
|
|
Workspace string `json:"workspace"`
|
|
} `json:"secret"`
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode GetSecretByNameV4500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseUpdateSecretV4Response parses an HTTP response from a UpdateSecretV4WithResponse call
|
|
func ParseUpdateSecretV4Response(rsp *http.Response) (*UpdateSecretV4Response, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &UpdateSecretV4Response{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
union json.RawMessage
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode UpdateSecretV4500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseCreateSecretV4Response parses an HTTP response from a CreateSecretV4WithResponse call
|
|
func ParseCreateSecretV4Response(rsp *http.Response) (*CreateSecretV4Response, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &CreateSecretV4Response{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
union json.RawMessage
|
|
}
|
|
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 struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4400StatusCode `json:"statusCode"`
|
|
}
|
|
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 struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4401StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 403:
|
|
var dest struct {
|
|
Details interface{} `json:"details,omitempty"`
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4403StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4404StatusCode `json:"statusCode"`
|
|
}
|
|
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 == 422:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message interface{} `json:"message,omitempty"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4422StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
|
|
var dest struct {
|
|
Error string `json:"error"`
|
|
Message string `json:"message"`
|
|
ReqId string `json:"reqId"`
|
|
StatusCode CreateSecretV4500StatusCode `json:"statusCode"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON500 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|