diff --git a/openapi/catalog.gen.go b/openapi/catalog.gen.go index 5503daa..2321fa3 100644 --- a/openapi/catalog.gen.go +++ b/openapi/catalog.gen.go @@ -1,6 +1,6 @@ // Package openapi provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. package openapi // Defines values for AccessTokenOptsAttachmentType. @@ -84,6 +84,27 @@ func (e AuthType) Valid() bool { } } +// Defines values for CustomAuthInputFieldType. +const ( + FieldTypePassword CustomAuthInputFieldType = "fieldTypePassword" + FieldTypeSelect CustomAuthInputFieldType = "fieldTypeSelect" + FieldTypeText CustomAuthInputFieldType = "fieldTypeText" +) + +// Valid indicates whether the value is a known member of the CustomAuthInputFieldType enum. +func (e CustomAuthInputFieldType) Valid() bool { + switch e { + case FieldTypePassword: + return true + case FieldTypeSelect: + return true + case FieldTypeText: + return true + default: + return false + } +} + // Defines values for Oauth2OptsGrantType. const ( AuthorizationCode Oauth2OptsGrantType = "authorizationCode" @@ -116,6 +137,8 @@ type AccessTokenOpts struct { AttachmentType AccessTokenOptsAttachmentType `json:"attachmentType" validate:"required"` // DocsURL URL with more information about how access token is used. + // + // Example: https://docs.example.com/oauth2-access-token-usage DocsURL string `json:"docsURL,omitempty"` // Header Configuration for access token in header. Must be provided if type is in-header. @@ -128,22 +151,32 @@ type AccessTokenOptsAttachmentType string // AccessTokenOptsHeader Configuration for access token in header. Must be provided if type is in-header. type AccessTokenOptsHeader struct { // Name The name of the header to be used for the access token. + // + // Example: X-Access-Token Name string `json:"name"` // ValuePrefix The prefix to be added to the access token value when it is sent in the header. + // + // Example: Bearer ValuePrefix string `json:"valuePrefix,omitempty"` } // ApiKeyAsBasicOpts when this object is present, it means that this provider uses Basic Auth to actually collect an API key type ApiKeyAsBasicOpts struct { // FieldUsed whether the API key should be used as the username or password. + // + // Example: username FieldUsed ApiKeyAsBasicOptsFieldUsed `json:"fieldUsed,omitempty"` // KeyFormat How to transform the API key in to a basic auth user:pass string. The %s is replaced with the API key value. + // + // Example: api:%s KeyFormat string `json:"keyFormat,omitempty"` } // ApiKeyAsBasicOptsFieldUsed whether the API key should be used as the username or password. +// +// Example: username type ApiKeyAsBasicOptsFieldUsed string // ApiKeyOpts Configuration for API key. Must be provided if authType is apiKey. @@ -152,6 +185,8 @@ type ApiKeyOpts struct { AttachmentType ApiKeyOptsAttachmentType `json:"attachmentType" validate:"required"` // DocsURL URL with more information about how to get or use an API key. + // + // Example: https://docs.example.com/api-key DocsURL string `json:"docsURL,omitempty"` // Header Configuration for API key in header. Must be provided if type is in-header. @@ -167,27 +202,39 @@ type ApiKeyOptsAttachmentType string // ApiKeyOptsHeader Configuration for API key in header. Must be provided if type is in-header. type ApiKeyOptsHeader struct { // Name The name of the header to be used for the API key. + // + // Example: X-Api-Key Name string `json:"name"` // ValuePrefix The prefix to be added to the API key value when it is sent in the header. + // + // Example: Bearer ValuePrefix string `json:"valuePrefix,omitempty"` } // ApiKeyOptsQuery Configuration for API key in query parameter. Must be provided if type is in-query. type ApiKeyOptsQuery struct { // Name The name of the query parameter to be used for the API key. + // + // Example: api_key Name string `json:"name"` } // AuthHealthCheck A URL to check the health of a provider's credentials. It's used to see if the credentials are valid and if the provider is reachable. type AuthHealthCheck struct { // Method The HTTP method to use for the health check. If not set, defaults to GET. + // + // Example: GET Method string `json:"method,omitempty"` // SuccessStatusCodes The HTTP status codes that indicate a successful health check. If not set, defaults to 200 and 204. + // + // Example: [200,204] SuccessStatusCodes []int `json:"successStatusCodes,omitempty"` // Url a no-op URL to check the health of the credentials. The URL MUST not mutate any state. If the provider doesn't have such an endpoint, then don't provide credentialsHealthCheck. + // + // Example: https://api.example.com/health-check Url string `json:"url"` } @@ -197,12 +244,16 @@ type AuthType string // BasicAuthOpts Configuration for Basic Auth. Optional. type BasicAuthOpts struct { // ApiKeyAsBasic If true, the provider uses an API key which then gets encoded as a basic auth user:pass string. + // + // Example: true ApiKeyAsBasic bool `json:"apiKeyAsBasic,omitempty"` // ApiKeyAsBasicOpts when this object is present, it means that this provider uses Basic Auth to actually collect an API key ApiKeyAsBasicOpts *ApiKeyAsBasicOpts `json:"apiKeyAsBasicOpts,omitempty"` // DocsURL URL with more information about how to get or use an API key. + // + // Example: https://docs.example.com/api-key DocsURL string `json:"docsURL,omitempty"` } @@ -242,33 +293,73 @@ type CatalogWrapper struct { Catalog CatalogType `json:"catalog"` // Timestamp An RFC3339 formatted timestamp of when the catalog was generated. + // + // Example: 2024-07-30T15:14:51-07:00 Timestamp string `json:"timestamp" validate:"required"` } // CustomAuthHeader A custom header to be used for authentication. Automatically added by the backend. type CustomAuthHeader struct { // Name The name of the header. + // + // Example: X-Custom-Auth Name string `json:"name"` // ValueTemplate The value of the header, represented as a Golang text/template expression. Only the backend will interpret this. + // + // Example: Bearer {{ .token }} ValueTemplate string `json:"valueTemplate" skipSubstitutions:"true"` } // CustomAuthInput A custom input field for authentication. This is used by the frontend to dynamically render input fields for custom auth. The backend will not interpret this. It will however receive the value of this field before making a request (in the connection secrets). type CustomAuthInput struct { // DisplayName The human-readable name for the custom auth input field. + // + // Example: Custom Auth Input DisplayName string `json:"displayName"` // DocsURL URL with details about this authentication mechanism and how to use it. Might be specific to this field, or a general URL for the provider. Optional. + // + // Example: https://docs.example.com/custom-auth-input DocsURL string `json:"docsURL,omitempty"` + // FieldType How the frontend should render this input. "fieldTypeText" is an unmasked field (not sensitive), "fieldTypePassword" is a masked field (sensitive), and "fieldTypeSelect" is a dropdown populated from options. Defaults to "fieldTypePassword" when omitted. + // + // Example: fieldTypePassword + FieldType CustomAuthInputFieldType `json:"fieldType,omitempty"` + // Name The internal identifier for the custom auth input field. + // + // Example: custom_auth_input Name string `json:"name"` + // Options The dropdown options, used only when fieldType is "select". + Options []CustomAuthInputOption `json:"options,omitempty"` + // Prompt Some helpful text or context to be displayed to the user when asking for this input. + // + // Example: See Authorization section of provider docs to obtain this value Prompt string `json:"prompt,omitempty"` } +// CustomAuthInputFieldType How the frontend should render this input. "fieldTypeText" is an unmasked field (not sensitive), "fieldTypePassword" is a masked field (sensitive), and "fieldTypeSelect" is a dropdown populated from options. Defaults to "fieldTypePassword" when omitted. +// +// Example: fieldTypePassword +type CustomAuthInputFieldType string + +// CustomAuthInputOption A selectable option for a custom auth input whose fieldType is "select". +type CustomAuthInputOption struct { + // Label The human-readable label shown for this option. + // + // Example: Production + Label string `json:"label"` + + // Value The value stored when this option is selected. + // + // Example: prod + Value string `json:"value"` +} + // CustomAuthOpts Configuration for custom auth. Optional. type CustomAuthOpts struct { // Headers A list of custom headers to be used for authentication. The backend will add these headers. @@ -277,6 +368,14 @@ type CustomAuthOpts struct { // Inputs A list of custom input fields for authentication. The frontend will render these input fields and the backend will receive the values of these fields before making a request. Inputs []CustomAuthInput `json:"inputs,omitempty"` + // MultiStep Whether this provider uses a multi-step custom auth flow (browser redirects and/or server-side credential-exchange calls) driven by the /custom-auth/connect endpoint, rather than static header/query-param injection. The step definitions and handlers live in the connectors library, not the catalog; this flag is the signal that lets clients tell "multi-step custom" apart from plain "custom" at a glance. + // + // Example: true + MultiStep bool `json:"multiStep,omitempty"` + + // ProviderInputs Input fields the builder configures on their provider app (e.g. client secrets, subscription keys) rather than the consumer. Routed to storage by fieldType. Optional. + ProviderInputs []CustomAuthInput `json:"providerInputs,omitempty"` + // QueryParams A list of custom query parameters to be used for authentication. The backend will add these query parameters. QueryParams []CustomAuthQueryParam `json:"queryParams,omitempty"` } @@ -284,9 +383,13 @@ type CustomAuthOpts struct { // CustomAuthQueryParam A custom query parameter to be used for authentication. Automatically added by the backend. type CustomAuthQueryParam struct { // Name The name of the query parameter. + // + // Example: custom_auth Name string `json:"name"` // ValueTemplate The value of the query parameter, represented as a Golang text/template expression. Only the backend will interpret this. + // + // Example: {{ .token }} ValueTemplate string `json:"valueTemplate" skipSubstitutions:"true"` } @@ -305,18 +408,26 @@ type Media struct { // MediaTypeDarkMode Media to be used in dark mode. type MediaTypeDarkMode struct { // IconURL URL to the icon for the provider that is to be used in dark mode. + // + // Example: https://example.com/icon.png IconURL string `json:"iconURL,omitempty"` // LogoURL URL to the logo for the provider that is to be used in dark mode. + // + // Example: https://example.com/logo.png LogoURL string `json:"logoURL,omitempty"` } // MediaTypeRegular Media for light/regular mode. type MediaTypeRegular struct { // IconURL URL to the icon for the provider. + // + // Example: https://example.com/icon.png IconURL string `json:"iconURL,omitempty"` // LogoURL URL to the logo for the provider. + // + // Example: https://example.com/logo.png LogoURL string `json:"logoURL,omitempty"` } @@ -329,6 +440,8 @@ type MetadataItemInput struct { DisplayName string `json:"displayName,omitempty"` // DocsURL URL with more information about how to locate this value + // + // Example: https://example.com/how-to-find-subdomain DocsURL string `json:"docsURL,omitempty"` // ModuleDependencies Specifies which modules REQUIRE (depend on) this metadata item. This field lists the modules that depend on/require the metadata item. Example: If "workspace" metadata has moduleDependencies: {crm: {}}, it means the CRM module requires the workspace metadata to function. Each module that needs this metadata item MUST be specified in this field. Even if it is all modules. The empty ModuleDependency {} is for future-proofing in case we need to add additional configuration options. @@ -379,36 +492,59 @@ type Oauth2Opts struct { AccessTokenOpts *AccessTokenOpts `json:"accessTokenOpts,omitempty"` // Audience A list of URLs that represent the audience for the token, which is needed for some client credential grant flows. + // + // Example: ["https://api.mparticle.com"] Audience []string `json:"audience,omitempty"` // AuthURL The authorization URL. - AuthURL string `json:"authURL,omitempty"` + // + // Example: https://login.salesforce.com/services/oauth2/authorize + AuthURL string `json:"authURL,omitempty"` + + // AuthURLParams Example: {"access_type":"offline","duration":"permanent"} AuthURLParams map[string]string `json:"authURLParams,omitempty"` // DocsURL URL with more information about where to retrieve Client ID and Client Secret, etc. + // + // Example: https://docs.example.com/client-credentials DocsURL string `json:"docsURL,omitempty"` // ExplicitScopesRequired Whether scopes are required to be known ahead of the OAuth flow. + // + // Example: true ExplicitScopesRequired bool `json:"explicitScopesRequired"` // ExplicitWorkspaceRequired Whether the workspace is required to be known ahead of the OAuth flow. + // + // Example: true ExplicitWorkspaceRequired bool `json:"explicitWorkspaceRequired"` GrantType Oauth2OptsGrantType `json:"grantType"` + // KeepAliveIntervalHours How many hours between proactive token keep-alive refreshes for this provider. + // Token-manager adds a random stagger offset on top. If absent, defaults to 24. + // + // + // Example: 120 + KeepAliveIntervalHours int `json:"keepAliveIntervalHours,omitempty"` + // ScopeMappings Maps input scopes to their full OAuth scope values with template variable support. Scopes not in this map are passed through unchanged. Needed for some providers. + // + // Example: {"default":"https://{{.workspace}}.api.com/default"} ScopeMappings map[string]string `json:"scopeMappings,omitempty"` // TokenMetadataFields Fields to be used to extract token metadata from the token response. TokenMetadataFields TokenMetadataFields `json:"tokenMetadataFields"` // TokenURL The token URL. + // + // Example: https://login.salesforce.com/services/oauth2/token TokenURL string `json:"tokenURL" validate:"required"` } // Oauth2OptsGrantType defines model for Oauth2Opts.GrantType. type Oauth2OptsGrantType string -// Provider defines model for Provider. +// Provider Example: salesforce type Provider = string // ProviderAppMetadata Describes the provider-app-level fields that the Ampersand dashboard should collect from the builder when creating a ProviderApp for this provider. These descriptors tell the dashboard which form fields to render; the submitted values are stored in ProviderApp.metadata. @@ -442,6 +578,8 @@ type ProviderInfo struct { DefaultModule string `json:"defaultModule"` // DisplayName The display name of the provider, if omitted, defaults to provider name. + // + // Example: Zendesk Chat DisplayName string `json:"displayName,omitempty"` Labels *Labels `json:"labels,omitempty"` Media *Media `json:"media,omitempty"` @@ -457,6 +595,8 @@ type ProviderInfo struct { Oauth2Opts *Oauth2Opts `json:"oauth2Opts,omitempty"` // PostAuthInfoNeeded If true, we require additional information after auth to start making requests. + // + // Example: true PostAuthInfoNeeded bool `json:"postAuthInfoNeeded,omitempty"` // ProviderAppMetadata Describes the provider-app-level fields that the Ampersand dashboard should collect from the builder when creating a ProviderApp for this provider. These descriptors tell the dashboard which form fields to render; the submitted values are stored in ProviderApp.metadata. @@ -526,17 +666,24 @@ type Support struct { // TokenMetadataFields Fields to be used to extract token metadata from the token response. type TokenMetadataFields struct { + // ConsumerRefField Example: user-id ConsumerRefField string `json:"consumerRefField,omitempty"` // OtherFields Additional fields to extract and transform from the token response - OtherFields *TokenMetadataFieldsOtherFields `json:"otherFields,omitempty"` - ScopesField string `json:"scopesField,omitempty"` - WorkspaceRefField string `json:"workspaceRefField,omitempty"` + OtherFields *TokenMetadataFieldsOtherFields `json:"otherFields,omitempty"` + + // ScopesField Example: scopes + ScopesField string `json:"scopesField,omitempty"` + + // WorkspaceRefField Example: account-id + WorkspaceRefField string `json:"workspaceRefField,omitempty"` } // TokenMetadataFieldsOtherFields Additional fields to extract and transform from the token response type TokenMetadataFieldsOtherFields = []struct { // Capture A regex expression to capture the value that we need from the path. There must be only one capture group named 'result' in the expression. If not provided, will cause an error. + // + // Example: https:\/\/(?[^.]+)\.docusign\.net Capture string `json:"capture,omitempty"` // DisplayName The human-readable name of the field @@ -546,5 +693,7 @@ type TokenMetadataFieldsOtherFields = []struct { Name string `json:"name"` // Path The path to the field in the token response (accepts dot notation for nested fields) + // + // Example: owner.siteId Path string `json:"path"` } diff --git a/openapi/manifest.gen.go b/openapi/manifest.gen.go index ae4d00b..e15f1de 100644 --- a/openapi/manifest.gen.go +++ b/openapi/manifest.gen.go @@ -1,6 +1,6 @@ // Package openapi provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. package openapi import ( @@ -251,9 +251,13 @@ type CreateEventEnabled string // DefaultPeriod defines model for DefaultPeriod. type DefaultPeriod struct { // Days Number of days in past to backfill from. 0 is no backfill. e.g) if 10, then backfill last 10 days of data. Required if fullHistory is not set. + // + // Example: 30 Days *int `json:"days,omitempty" validate:"required_without=FullHistory,omitempty,min=0"` // FullHistory If true, backfill all history. Required if days is not set. + // + // Example: false FullHistory *bool `json:"fullHistory,omitempty" validate:"required_without=Days"` } @@ -308,21 +312,33 @@ type FieldDeletedEventEnabled string // FieldMetadata Metadata about a field. Please note that different providers have different levels of support for field metadata. Please reach out to support@withampersand.com if need expanded support for a particular provider. type FieldMetadata struct { // DisplayName The display name of the field from the provider API. + // + // Example: Account ID DisplayName string `json:"displayName"` // FieldName The name of the field from the provider API. + // + // Example: accountid FieldName string `json:"fieldName"` // IsCustom Whether the field is custom field. + // + // Example: false IsCustom *bool `json:"isCustom,omitempty"` // IsRequired Whether the field is required when creating a new record. + // + // Example: false IsRequired *bool `json:"isRequired,omitempty"` // ProviderType Raw field type from the provider API. + // + // Example: timestamp ProviderType string `json:"providerType,omitempty"` // ReadOnly Whether the field is read-only. + // + // Example: false ReadOnly *bool `json:"readOnly,omitempty"` // ReferenceTo The list of object types this field references. Only applicable if the providerType is a lookup/reference field. @@ -341,21 +357,32 @@ type FieldMetadataValueType string // FieldValue Represents a field value type FieldValue struct { // DisplayValue The human-readable display value + // + // Example: Outbound Campaign DisplayValue string `json:"displayValue"` // Value The internal value used by the system + // + // Example: outbound Value string `json:"value"` } // HydratedIntegration defines model for HydratedIntegration. type HydratedIntegration struct { - DisplayName string `json:"displayName,omitempty"` - Module string `json:"module,omitempty"` - Name string `json:"name"` - Provider string `json:"provider"` - Proxy *HydratedIntegrationProxy `json:"proxy,omitempty"` - Read *HydratedIntegrationRead `json:"read,omitempty"` - Write *HydratedIntegrationWrite `json:"write,omitempty"` + // DisplayName Example: Salesforce Accounts + DisplayName string `json:"displayName,omitempty"` + + // Module Example: crm + Module string `json:"module,omitempty"` + + // Name Example: readSalesforceAccounts + Name string `json:"name"` + + // Provider Example: salesforce + Provider string `json:"provider"` + Proxy *HydratedIntegrationProxy `json:"proxy,omitempty"` + Read *HydratedIntegrationRead `json:"read,omitempty"` + Write *HydratedIntegrationWrite `json:"write,omitempty"` } // HydratedIntegrationField defines model for HydratedIntegrationField. @@ -365,13 +392,20 @@ type HydratedIntegrationField struct { // HydratedIntegrationFieldExistent defines model for HydratedIntegrationFieldExistent. type HydratedIntegrationFieldExistent struct { + // DisplayName Example: Billing City DisplayName string `json:"displayName"` - FieldName string `json:"fieldName"` + + // FieldName Example: billingcity + FieldName string `json:"fieldName"` // MapToDisplayName The display name to map to in the destination. + // + // Example: Billing City MapToDisplayName string `json:"mapToDisplayName,omitempty"` // MapToName The field name to map to in the destination. + // + // Example: billing_city MapToName string `json:"mapToName,omitempty"` } @@ -382,24 +416,38 @@ type HydratedIntegrationObject struct { AllFields *[]HydratedIntegrationField `json:"allFields,omitempty"` // AllFieldsMetadata This is a map of all fields on the object including their metadata (such as display name and type), the keys of the map are the field names. + // + // Example: {"name":{"displayName":"Account Name","fieldName":"name","isCustom":false,"isRequired":true,"providerType":"string","readOnly":false,"valueType":"string"},"type":{"displayName":"Account Type","fieldName":"type","isCustom":false,"isRequired":false,"providerType":"picklist","readOnly":false,"valueType":"singleSelect","values":[{"displayValue":"Prospect","value":"prospect"},{"displayValue":"Customer - Direct","value":"customer"}]}} AllFieldsMetadata *map[string]FieldMetadata `json:"allFieldsMetadata,omitempty"` Backfill *Backfill `json:"backfill,omitempty"` - Destination string `json:"destination"` - DisplayName string `json:"displayName"` + + // Destination Example: accountWebhook + Destination string `json:"destination"` + + // DisplayName Example: Account + DisplayName string `json:"displayName"` // Error Error message if there was an issue hydrating this object. Error string `json:"error,omitempty"` // MapToDisplayName A display name to map to. + // + // Example: Accounts MapToDisplayName string `json:"mapToDisplayName,omitempty"` // MapToName An object name to map to. - MapToName string `json:"mapToName,omitempty"` + // + // Example: accounts + MapToName string `json:"mapToName,omitempty"` + + // ObjectName Example: account ObjectName string `json:"objectName"` OptionalFields *[]HydratedIntegrationField `json:"optionalFields,omitempty"` OptionalFieldsAuto *OptionalFieldsAutoOption `json:"optionalFieldsAuto,omitempty"` RequiredFields *[]HydratedIntegrationField `json:"requiredFields,omitempty"` - Schedule string `json:"schedule"` + + // Schedule Example: */10 * * * * + Schedule string `json:"schedule"` } // HydratedIntegrationProxy defines model for HydratedIntegrationProxy. @@ -422,8 +470,11 @@ type HydratedIntegrationWrite struct { // HydratedIntegrationWriteObject defines model for HydratedIntegrationWriteObject. type HydratedIntegrationWriteObject struct { + // DisplayName Example: Account DisplayName string `json:"displayName"` - ObjectName string `json:"objectName"` + + // ObjectName Example: account + ObjectName string `json:"objectName"` // ValueDefaults Configuration to set default write values for object fields. ValueDefaults *ValueDefaults `json:"valueDefaults,omitempty"` @@ -454,9 +505,13 @@ type IntegrationFieldExistent struct { FieldName string `json:"fieldName"` // MapToDisplayName The display name to map to. + // + // Example: Account ID MapToDisplayName string `json:"mapToDisplayName,omitempty"` // MapToName The field name to map to. + // + // Example: account_id MapToName string `json:"mapToName,omitempty"` } @@ -478,9 +533,13 @@ type IntegrationObject struct { Enabled IntegrationObjectEnabled `json:"enabled,omitempty"` // MapToDisplayName A display name to map to. + // + // Example: People MapToDisplayName string `json:"mapToDisplayName,omitempty"` // MapToName An object name to map to. + // + // Example: people MapToName string `json:"mapToName,omitempty"` ObjectName string `json:"objectName"` OptionalFields *[]IntegrationField `json:"optionalFields,omitempty"` @@ -518,6 +577,8 @@ type IntegrationSubscribeObject struct { Destination string `json:"destination"` // InheritFieldsAndMapping If true, the integration will inherit the fields and mapping from the read object. + // + // Example: true InheritFieldsAndMapping bool `json:"inheritFieldsAndMapping,omitempty"` ObjectName string `json:"objectName"` OtherEvents *OtherEvents `json:"otherEvents,omitempty"` @@ -532,6 +593,8 @@ type IntegrationWrite struct { // IntegrationWriteObject defines model for IntegrationWriteObject. type IntegrationWriteObject struct { // InheritMapping If true, the write object will inherit the mapping from the read object. If false, the write object will have no mapping. + // + // Example: true InheritMapping *bool `json:"inheritMapping,omitempty"` ObjectName string `json:"objectName"` @@ -560,6 +623,8 @@ type UpdateEvent struct { RequiredWatchFields *[]string `json:"requiredWatchFields,omitempty"` // WatchFieldsAuto If `all`, the integration will watch all fields for updates. If `selected`, the integration will watch only the fields that are selected by the user. If `inheritFieldsAndMapping` is true for Subscribe action, the integration will watch the selected fields from read action that are selected by the user. + // + // Example: all WatchFieldsAuto *UpdateEventWatchFieldsAuto `json:"watchFieldsAuto,omitempty"` } @@ -567,11 +632,15 @@ type UpdateEvent struct { type UpdateEventEnabled string // UpdateEventWatchFieldsAuto If `all`, the integration will watch all fields for updates. If `selected`, the integration will watch only the fields that are selected by the user. If `inheritFieldsAndMapping` is true for Subscribe action, the integration will watch the selected fields from read action that are selected by the user. +// +// Example: all type UpdateEventWatchFieldsAuto string // ValueDefaults Configuration to set default write values for object fields. type ValueDefaults struct { // AllowAnyFields If true, users can set default values for any field. + // + // Example: true AllowAnyFields *bool `json:"allowAnyFields,omitempty"` } @@ -581,9 +650,13 @@ type WatchSchema struct { AllObjects WatchSchemaAllObjects `json:"allObjects"` // Destination The destination to send schema change notifications to. + // + // Example: fieldWatchStream Destination string `json:"destination"` // Schedule Cron schedule for checking schema changes. Minimum frequency is once per hour. Defaults to once a day. + // + // Example: 0 */6 * * * Schedule string `json:"schedule,omitempty"` } diff --git a/openapi/problem.gen.go b/openapi/problem.gen.go index 30ef3b2..dcbadb2 100644 --- a/openapi/problem.gen.go +++ b/openapi/problem.gen.go @@ -1,22 +1,188 @@ // Package openapi provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. package openapi -// ApiProblem A Problem Details object (RFC 9457). -// -// Additional properties specific to the problem type may be present. -type ApiProblem = Problem +import ( + "time" + + openapi_types "github.com/oapi-codegen/runtime/types" +) + +// Defines values for InputValidationIssueIn. +const ( + Body InputValidationIssueIn = "body" + Header InputValidationIssueIn = "header" + Path InputValidationIssueIn = "path" + Query InputValidationIssueIn = "query" +) + +// Valid indicates whether the value is a known member of the InputValidationIssueIn enum. +func (e InputValidationIssueIn) Valid() bool { + switch e { + case Body: + return true + case Header: + return true + case Path: + return true + case Query: + return true + default: + return false + } +} + +// ApiProblem defines model for ApiProblem. +type ApiProblem struct { + // Causes A list of problems that caused this problem. This can be used to represent multiple + // root causes. There is no guaranteed ordering of the causes. + // + // + // Example: ["database connection failed","database query failed","unable to fetch user"] + Causes *[]string `json:"causes,omitempty"` + + // Context Additional context for the problem + // + // Example: {"name":"Rick Sanchez"} + Context *map[string]interface{} `json:"context,omitempty"` + + // Detail A human-readable explanation specific to this occurrence of the problem + Detail *string `json:"detail,omitempty"` + + // Href An absolute URI that, when dereferenced, provides human-readable documentation for the problem type (e.g. using HTML). + Href *string `json:"href,omitempty"` + + // Instance An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. + Instance *string `json:"instance,omitempty"` + + // Remedy A brief description of how to resolve the problem + // + // Example: Shorten your input to be under 100 characters + Remedy *string `json:"remedy,omitempty"` + + // RequestId A unique identifier for the request, useful for debugging + // + // Example: 89eb1ffb-2a54-4105-aaae-7bf990f1aa69#87715 + RequestId *string `json:"requestId,omitempty"` + + // RetryAfter A timestamp after which the request can be retried, formatted as RFC-3339 + // + // Example: 2024-04-22T18:55:28.456076Z + RetryAfter *time.Time `json:"retryAfter,omitempty"` -// InputValidationIssue defines model for InputValidationIssue. -type InputValidationIssue = ApiProblem + // Retryable Whether the request can be retried + // + // Example: false + Retryable *bool `json:"retryable,omitempty"` + + // Status The HTTP status code generated by the origin server for this occurrence of the problem. + // + // Example: 503 + Status *int32 `json:"status,omitempty"` + + // Subsystem The subsystem that generated the problem + // + // Example: api + Subsystem *string `json:"subsystem,omitempty"` + + // SupportEmail An email address to contact for support + // + // Example: support@withampersand.com + SupportEmail *openapi_types.Email `json:"supportEmail,omitempty"` + + // SupportPhone A phone number to contact for support + // + // Example: +1-555-555-5555 + SupportPhone *string `json:"supportPhone,omitempty"` + + // SupportUrl A URL to contact for support + // + // Example: https://withampersand.com/support + SupportUrl *string `json:"supportUrl,omitempty"` + + // Time The time the problem occurred, formatted as RFC-3339 + // + // Example: 2024-04-22T18:55:28.456076Z + Time *time.Time `json:"time,omitempty"` + + // Title A short summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized). + // + // Example: Service Unavailable + Title *string `json:"title,omitempty"` + + // Type An absolute URI that identifies the problem type + Type *string `json:"type,omitempty"` +} + +// InputValidationIssue An issue detected during input validation. +type InputValidationIssue struct { + // Detail A human-readable explanation specific to this occurrence of the problem + Detail *string `json:"detail,omitempty"` + + // Href An absolute URI that, when dereferenced, provides human-readable documentation for the problem type (e.g. using HTML). + Href *string `json:"href,omitempty"` + + // In The location of the invalid input + In *InputValidationIssueIn `json:"in,omitempty"` + + // Instance An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. + Instance *string `json:"instance,omitempty"` + + // Name The name of the invalid input + Name *string `json:"name,omitempty"` + + // Status The HTTP status code generated by the origin server for this occurrence of the problem. + // + // Example: 503 + Status *int32 `json:"status,omitempty"` + + // Title A short summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized). + // + // Example: Service Unavailable + Title *string `json:"title,omitempty"` + + // Type An absolute URI that identifies the problem type + Type *string `json:"type,omitempty"` + + // Value The value of the erroneous input + Value interface{} `json:"value,omitempty"` +} + +// InputValidationIssueIn The location of the invalid input +type InputValidationIssueIn string // InputValidationProblem defines model for InputValidationProblem. -type InputValidationProblem = ApiProblem +type InputValidationProblem struct { + // Detail A human-readable explanation specific to this occurrence of the problem + Detail *string `json:"detail,omitempty"` + + // Href An absolute URI that, when dereferenced, provides human-readable documentation for the problem type (e.g. using HTML). + Href *string `json:"href,omitempty"` + + // Instance An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. + Instance *string `json:"instance,omitempty"` + Issues *[]InputValidationIssue `json:"issues,omitempty"` + + // Status The HTTP status code generated by the origin server for this occurrence of the problem. + // + // Example: 503 + Status *int32 `json:"status,omitempty"` + + // Title A short summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized). + // + // Example: Service Unavailable + Title *string `json:"title,omitempty"` + + // Type An absolute URI that identifies the problem type + Type *string `json:"type,omitempty"` +} // Problem A Problem Details object (RFC 9457). // // Additional properties specific to the problem type may be present. +// +// Example: {"detail":"Description of specific occurrence of the problem","href":"https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types","instance":"urn:uuid:123e4567-e89b-12d3-a456-426614174000","status":400,"title":"Description of the type of problem that occurred","type":"urn:problem-type:exampleOrganization:exampleProblem"} type Problem struct { // Detail A human-readable explanation specific to this occurrence of the problem Detail *string `json:"detail,omitempty"` @@ -28,19 +194,25 @@ type Problem struct { Instance *string `json:"instance,omitempty"` // Status The HTTP status code generated by the origin server for this occurrence of the problem. + // + // Example: 503 Status *int32 `json:"status,omitempty"` // Title A short summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized). + // + // Example: Service Unavailable Title *string `json:"title,omitempty"` // Type An absolute URI that identifies the problem type Type *string `json:"type,omitempty"` } -// InputValidationProblemResponse defines model for InputValidationProblemResponse. +// InputValidationProblemResponse Example: {"detail":"The input message is incorrect","instance":"123456-1234-1235-4567489798","issues":[{"detail":"exampleNumericProperty should be numeric","in":"path","name":"exampleNumericProperty","type":"about:blank","value":"abc"},{"detail":"examplePropertyWithPattern a2345678901 doesn't match pattern '^\\d{11}$'","in":"body","name":"items[0].examplePropertyWithPattern","title":"Input isn't valid with respect to schema","type":"about:blank","value":"a2345678901"}],"status":400,"title":"Bad Request","type":"about:blank"} type InputValidationProblemResponse = InputValidationProblem // ProblemResponse A Problem Details object (RFC 9457). // // Additional properties specific to the problem type may be present. +// +// Example: {"detail":"Description of specific occurrence of the problem","href":"https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types","instance":"urn:uuid:123e4567-e89b-12d3-a456-426614174000","status":400,"title":"Description of the type of problem that occurred","type":"urn:problem-type:exampleOrganization:exampleProblem"} type ProblemResponse = Problem