From 92351a143415e3084027a49c30e84903d4ebed32 Mon Sep 17 00:00:00 2001 From: Andrew Min Date: Wed, 2 Oct 2024 17:49:55 -0400 Subject: [PATCH 1/2] release v2024.9.31 --- api/public_api.swagger.json | 107 +++++++++- .../delete_sub_organization_parameters.go | 150 ++++++++++++++ .../delete_sub_organization_responses.go | 103 ++++++++++ .../organizations/organizations_client.go | 43 ++++ .../private_keys/private_keys_client.go | 2 +- pkg/api/client/wallets/wallets_client.go | 2 +- pkg/api/models/activity_type.go | 5 +- pkg/api/models/address_format.go | 68 ++++++- .../create_read_write_session_intent_v2.go | 16 +- .../models/delete_sub_organization_intent.go | 50 +++++ .../models/delete_sub_organization_request.go | 192 ++++++++++++++++++ .../models/delete_sub_organization_result.go | 71 +++++++ pkg/api/models/intent.go | 51 +++++ pkg/api/models/result.go | 51 +++++ pkg/api/models/transaction_type.go | 5 +- 15 files changed, 890 insertions(+), 26 deletions(-) create mode 100644 pkg/api/client/organizations/delete_sub_organization_parameters.go create mode 100644 pkg/api/client/organizations/delete_sub_organization_responses.go create mode 100644 pkg/api/models/delete_sub_organization_intent.go create mode 100644 pkg/api/models/delete_sub_organization_request.go create mode 100644 pkg/api/models/delete_sub_organization_result.go diff --git a/api/public_api.swagger.json b/api/public_api.swagger.json index f9fae8f..019eb65 100644 --- a/api/public_api.swagger.json +++ b/api/public_api.swagger.json @@ -1185,7 +1185,7 @@ }, "/public/v1/submit/delete_private_keys": { "post": { - "summary": "Delete organization private keys", + "summary": "Delete Private Keys", "description": "Deletes private keys for an organization", "operationId": "DeletePrivateKeys", "responses": { @@ -1209,6 +1209,32 @@ "tags": ["Private Keys"] } }, + "/public/v1/submit/delete_sub_organization": { + "post": { + "summary": "Delete Sub Organization", + "description": "Deletes a sub organization", + "operationId": "DeleteSubOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteSubOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/submit/delete_user_tags": { "post": { "summary": "Delete User Tags", @@ -1263,7 +1289,7 @@ }, "/public/v1/submit/delete_wallets": { "post": { - "summary": "Delete organization wallets", + "summary": "Delete Wallets", "description": "Deletes wallets for an organization", "operationId": "DeleteWallets", "responses": { @@ -2104,7 +2130,8 @@ "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6", "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", "ACTIVITY_TYPE_DELETE_WALLETS", - "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" ] }, "AddressFormat": { @@ -2115,7 +2142,29 @@ "ADDRESS_FORMAT_ETHEREUM", "ADDRESS_FORMAT_SOLANA", "ADDRESS_FORMAT_COSMOS", - "ADDRESS_FORMAT_TRON" + "ADDRESS_FORMAT_TRON", + "ADDRESS_FORMAT_SUI", + "ADDRESS_FORMAT_APTOS", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" ] }, "Any": { @@ -3154,7 +3203,7 @@ "description": "Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used." } }, - "required": ["targetPublicKey", "userId"] + "required": ["targetPublicKey"] }, "CreateReadWriteSessionRequest": { "type": "object", @@ -4176,6 +4225,46 @@ }, "required": ["privateKeyIds"] }, + "DeleteSubOrganizationIntent": { + "type": "object", + "properties": { + "deleteWithoutExport": { + "type": "boolean", + "description": "Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false." + } + } + }, + "DeleteSubOrganizationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/DeleteSubOrganizationIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeleteSubOrganizationResult": { + "type": "object", + "properties": { + "subOrganizationUuid": { + "type": "string", + "description": "Unique identifier of the sub organization that was removed" + } + }, + "required": ["subOrganizationUuid"] + }, "DeleteUserTagsIntent": { "type": "object", "properties": { @@ -5652,6 +5741,9 @@ }, "createReadWriteSessionIntentV2": { "$ref": "#/definitions/CreateReadWriteSessionIntentV2" + }, + "deleteSubOrganizationIntent": { + "$ref": "#/definitions/DeleteSubOrganizationIntent" } } }, @@ -6399,6 +6491,9 @@ }, "createReadWriteSessionResultV2": { "$ref": "#/definitions/CreateReadWriteSessionResultV2" + }, + "deleteSubOrganizationResult": { + "$ref": "#/definitions/DeleteSubOrganizationResult" } } }, @@ -6905,7 +7000,7 @@ }, "TransactionType": { "type": "string", - "enum": ["TRANSACTION_TYPE_ETHEREUM"] + "enum": ["TRANSACTION_TYPE_ETHEREUM", "TRANSACTION_TYPE_SOLANA"] }, "UpdateAllowedOriginsIntent": { "type": "object", diff --git a/pkg/api/client/organizations/delete_sub_organization_parameters.go b/pkg/api/client/organizations/delete_sub_organization_parameters.go new file mode 100644 index 0000000..8a9c762 --- /dev/null +++ b/pkg/api/client/organizations/delete_sub_organization_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/tkhq/go-sdk/pkg/api/models" +) + +// NewDeleteSubOrganizationParams creates a new DeleteSubOrganizationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteSubOrganizationParams() *DeleteSubOrganizationParams { + return &DeleteSubOrganizationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteSubOrganizationParamsWithTimeout creates a new DeleteSubOrganizationParams object +// with the ability to set a timeout on a request. +func NewDeleteSubOrganizationParamsWithTimeout(timeout time.Duration) *DeleteSubOrganizationParams { + return &DeleteSubOrganizationParams{ + timeout: timeout, + } +} + +// NewDeleteSubOrganizationParamsWithContext creates a new DeleteSubOrganizationParams object +// with the ability to set a context for a request. +func NewDeleteSubOrganizationParamsWithContext(ctx context.Context) *DeleteSubOrganizationParams { + return &DeleteSubOrganizationParams{ + Context: ctx, + } +} + +// NewDeleteSubOrganizationParamsWithHTTPClient creates a new DeleteSubOrganizationParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteSubOrganizationParamsWithHTTPClient(client *http.Client) *DeleteSubOrganizationParams { + return &DeleteSubOrganizationParams{ + HTTPClient: client, + } +} + +/* +DeleteSubOrganizationParams contains all the parameters to send to the API endpoint + + for the delete sub organization operation. + + Typically these are written to a http.Request. +*/ +type DeleteSubOrganizationParams struct { + + // Body. + Body *models.DeleteSubOrganizationRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete sub organization params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSubOrganizationParams) WithDefaults() *DeleteSubOrganizationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete sub organization params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteSubOrganizationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete sub organization params +func (o *DeleteSubOrganizationParams) WithTimeout(timeout time.Duration) *DeleteSubOrganizationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete sub organization params +func (o *DeleteSubOrganizationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete sub organization params +func (o *DeleteSubOrganizationParams) WithContext(ctx context.Context) *DeleteSubOrganizationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete sub organization params +func (o *DeleteSubOrganizationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete sub organization params +func (o *DeleteSubOrganizationParams) WithHTTPClient(client *http.Client) *DeleteSubOrganizationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete sub organization params +func (o *DeleteSubOrganizationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the delete sub organization params +func (o *DeleteSubOrganizationParams) WithBody(body *models.DeleteSubOrganizationRequest) *DeleteSubOrganizationParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the delete sub organization params +func (o *DeleteSubOrganizationParams) SetBody(body *models.DeleteSubOrganizationRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteSubOrganizationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/api/client/organizations/delete_sub_organization_responses.go b/pkg/api/client/organizations/delete_sub_organization_responses.go new file mode 100644 index 0000000..722c049 --- /dev/null +++ b/pkg/api/client/organizations/delete_sub_organization_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/tkhq/go-sdk/pkg/api/models" +) + +// DeleteSubOrganizationReader is a Reader for the DeleteSubOrganization structure. +type DeleteSubOrganizationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteSubOrganizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteSubOrganizationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[POST /public/v1/submit/delete_sub_organization] DeleteSubOrganization", response, response.Code()) + } +} + +// NewDeleteSubOrganizationOK creates a DeleteSubOrganizationOK with default headers values +func NewDeleteSubOrganizationOK() *DeleteSubOrganizationOK { + return &DeleteSubOrganizationOK{} +} + +/* +DeleteSubOrganizationOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type DeleteSubOrganizationOK struct { + Payload *models.ActivityResponse +} + +// IsSuccess returns true when this delete sub organization o k response has a 2xx status code +func (o *DeleteSubOrganizationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete sub organization o k response has a 3xx status code +func (o *DeleteSubOrganizationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete sub organization o k response has a 4xx status code +func (o *DeleteSubOrganizationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete sub organization o k response has a 5xx status code +func (o *DeleteSubOrganizationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete sub organization o k response a status code equal to that given +func (o *DeleteSubOrganizationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete sub organization o k response +func (o *DeleteSubOrganizationOK) Code() int { + return 200 +} + +func (o *DeleteSubOrganizationOK) Error() string { + return fmt.Sprintf("[POST /public/v1/submit/delete_sub_organization][%d] deleteSubOrganizationOK %+v", 200, o.Payload) +} + +func (o *DeleteSubOrganizationOK) String() string { + return fmt.Sprintf("[POST /public/v1/submit/delete_sub_organization][%d] deleteSubOrganizationOK %+v", 200, o.Payload) +} + +func (o *DeleteSubOrganizationOK) GetPayload() *models.ActivityResponse { + return o.Payload +} + +func (o *DeleteSubOrganizationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ActivityResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/api/client/organizations/organizations_client.go b/pkg/api/client/organizations/organizations_client.go index 4f8cec6..04df777 100644 --- a/pkg/api/client/organizations/organizations_client.go +++ b/pkg/api/client/organizations/organizations_client.go @@ -32,6 +32,8 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { CreateSubOrganization(params *CreateSubOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSubOrganizationOK, error) + DeleteSubOrganization(params *DeleteSubOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSubOrganizationOK, error) + GetOrganizationConfigs(params *GetOrganizationConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetOrganizationConfigsOK, error) GetSubOrgIds(params *GetSubOrgIdsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubOrgIdsOK, error) @@ -82,6 +84,47 @@ func (a *Client) CreateSubOrganization(params *CreateSubOrganizationParams, auth panic(msg) } +/* +DeleteSubOrganization deletes sub organization + +Deletes a sub organization +*/ +func (a *Client) DeleteSubOrganization(params *DeleteSubOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSubOrganizationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteSubOrganizationParams() + } + op := &runtime.ClientOperation{ + ID: "DeleteSubOrganization", + Method: "POST", + PathPattern: "/public/v1/submit/delete_sub_organization", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteSubOrganizationReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteSubOrganizationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for DeleteSubOrganization: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetOrganizationConfigs gets configs diff --git a/pkg/api/client/private_keys/private_keys_client.go b/pkg/api/client/private_keys/private_keys_client.go index 6b9a121..585aeb8 100644 --- a/pkg/api/client/private_keys/private_keys_client.go +++ b/pkg/api/client/private_keys/private_keys_client.go @@ -89,7 +89,7 @@ func (a *Client) CreatePrivateKeys(params *CreatePrivateKeysParams, authInfo run } /* -DeletePrivateKeys deletes organization private keys +DeletePrivateKeys deletes private keys Deletes private keys for an organization */ diff --git a/pkg/api/client/wallets/wallets_client.go b/pkg/api/client/wallets/wallets_client.go index 7d84622..547bb53 100644 --- a/pkg/api/client/wallets/wallets_client.go +++ b/pkg/api/client/wallets/wallets_client.go @@ -136,7 +136,7 @@ func (a *Client) CreateWalletAccounts(params *CreateWalletAccountsParams, authIn } /* -DeleteWallets deletes organization wallets +DeleteWallets deletes wallets Deletes wallets for an organization */ diff --git a/pkg/api/models/activity_type.go b/pkg/api/models/activity_type.go index 2ba504b..cfea8bc 100644 --- a/pkg/api/models/activity_type.go +++ b/pkg/api/models/activity_type.go @@ -254,6 +254,9 @@ const ( // ActivityTypeCreateReadWriteSessionV2 captures enum value "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" ActivityTypeCreateReadWriteSessionV2 ActivityType = "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" + + // ActivityTypeDeleteSubOrganization captures enum value "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" + ActivityTypeDeleteSubOrganization ActivityType = "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" ) // for schema @@ -261,7 +264,7 @@ var ActivityTypeEnum []ActivityType func init() { var res []ActivityType - if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_CREATE_API_KEYS","ACTIVITY_TYPE_CREATE_USERS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD","ACTIVITY_TYPE_CREATE_INVITATIONS","ACTIVITY_TYPE_ACCEPT_INVITATION","ACTIVITY_TYPE_CREATE_POLICY","ACTIVITY_TYPE_DISABLE_PRIVATE_KEY","ACTIVITY_TYPE_DELETE_USERS","ACTIVITY_TYPE_DELETE_API_KEYS","ACTIVITY_TYPE_DELETE_INVITATION","ACTIVITY_TYPE_DELETE_ORGANIZATION","ACTIVITY_TYPE_DELETE_POLICY","ACTIVITY_TYPE_CREATE_USER_TAG","ACTIVITY_TYPE_DELETE_USER_TAGS","ACTIVITY_TYPE_CREATE_ORGANIZATION","ACTIVITY_TYPE_SIGN_TRANSACTION","ACTIVITY_TYPE_APPROVE_ACTIVITY","ACTIVITY_TYPE_REJECT_ACTIVITY","ACTIVITY_TYPE_DELETE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS","ACTIVITY_TYPE_SET_PAYMENT_METHOD","ACTIVITY_TYPE_ACTIVATE_BILLING_TIER","ACTIVITY_TYPE_DELETE_PAYMENT_METHOD","ACTIVITY_TYPE_CREATE_POLICY_V2","ACTIVITY_TYPE_CREATE_POLICY_V3","ACTIVITY_TYPE_CREATE_API_ONLY_USERS","ACTIVITY_TYPE_UPDATE_ROOT_QUORUM","ACTIVITY_TYPE_UPDATE_USER_TAG","ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2","ACTIVITY_TYPE_CREATE_ORGANIZATION_V2","ACTIVITY_TYPE_CREATE_USERS_V2","ACTIVITY_TYPE_ACCEPT_INVITATION_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2","ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2","ACTIVITY_TYPE_UPDATE_USER","ACTIVITY_TYPE_UPDATE_POLICY","ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3","ACTIVITY_TYPE_CREATE_WALLET","ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS","ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY","ACTIVITY_TYPE_RECOVER_USER","ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE","ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2","ACTIVITY_TYPE_SIGN_TRANSACTION_V2","ACTIVITY_TYPE_EXPORT_PRIVATE_KEY","ACTIVITY_TYPE_EXPORT_WALLET","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4","ACTIVITY_TYPE_EMAIL_AUTH","ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT","ACTIVITY_TYPE_INIT_IMPORT_WALLET","ACTIVITY_TYPE_IMPORT_WALLET","ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_CREATE_POLICIES","ACTIVITY_TYPE_SIGN_RAW_PAYLOADS","ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION","ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS","ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5","ACTIVITY_TYPE_OAUTH","ACTIVITY_TYPE_CREATE_API_KEYS_V2","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION","ACTIVITY_TYPE_EMAIL_AUTH_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6","ACTIVITY_TYPE_DELETE_PRIVATE_KEYS","ACTIVITY_TYPE_DELETE_WALLETS","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_CREATE_API_KEYS","ACTIVITY_TYPE_CREATE_USERS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD","ACTIVITY_TYPE_CREATE_INVITATIONS","ACTIVITY_TYPE_ACCEPT_INVITATION","ACTIVITY_TYPE_CREATE_POLICY","ACTIVITY_TYPE_DISABLE_PRIVATE_KEY","ACTIVITY_TYPE_DELETE_USERS","ACTIVITY_TYPE_DELETE_API_KEYS","ACTIVITY_TYPE_DELETE_INVITATION","ACTIVITY_TYPE_DELETE_ORGANIZATION","ACTIVITY_TYPE_DELETE_POLICY","ACTIVITY_TYPE_CREATE_USER_TAG","ACTIVITY_TYPE_DELETE_USER_TAGS","ACTIVITY_TYPE_CREATE_ORGANIZATION","ACTIVITY_TYPE_SIGN_TRANSACTION","ACTIVITY_TYPE_APPROVE_ACTIVITY","ACTIVITY_TYPE_REJECT_ACTIVITY","ACTIVITY_TYPE_DELETE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_AUTHENTICATORS","ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS","ACTIVITY_TYPE_SET_PAYMENT_METHOD","ACTIVITY_TYPE_ACTIVATE_BILLING_TIER","ACTIVITY_TYPE_DELETE_PAYMENT_METHOD","ACTIVITY_TYPE_CREATE_POLICY_V2","ACTIVITY_TYPE_CREATE_POLICY_V3","ACTIVITY_TYPE_CREATE_API_ONLY_USERS","ACTIVITY_TYPE_UPDATE_ROOT_QUORUM","ACTIVITY_TYPE_UPDATE_USER_TAG","ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG","ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2","ACTIVITY_TYPE_CREATE_ORGANIZATION_V2","ACTIVITY_TYPE_CREATE_USERS_V2","ACTIVITY_TYPE_ACCEPT_INVITATION_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2","ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS","ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2","ACTIVITY_TYPE_UPDATE_USER","ACTIVITY_TYPE_UPDATE_POLICY","ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3","ACTIVITY_TYPE_CREATE_WALLET","ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS","ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY","ACTIVITY_TYPE_RECOVER_USER","ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE","ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE","ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2","ACTIVITY_TYPE_SIGN_TRANSACTION_V2","ACTIVITY_TYPE_EXPORT_PRIVATE_KEY","ACTIVITY_TYPE_EXPORT_WALLET","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4","ACTIVITY_TYPE_EMAIL_AUTH","ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT","ACTIVITY_TYPE_INIT_IMPORT_WALLET","ACTIVITY_TYPE_IMPORT_WALLET","ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_IMPORT_PRIVATE_KEY","ACTIVITY_TYPE_CREATE_POLICIES","ACTIVITY_TYPE_SIGN_RAW_PAYLOADS","ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION","ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS","ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5","ACTIVITY_TYPE_OAUTH","ACTIVITY_TYPE_CREATE_API_KEYS_V2","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION","ACTIVITY_TYPE_EMAIL_AUTH_V2","ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6","ACTIVITY_TYPE_DELETE_PRIVATE_KEYS","ACTIVITY_TYPE_DELETE_WALLETS","ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2","ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/api/models/address_format.go b/pkg/api/models/address_format.go index 5a6bafd..fcd5bf6 100644 --- a/pkg/api/models/address_format.go +++ b/pkg/api/models/address_format.go @@ -47,6 +47,72 @@ const ( // AddressFormatTron captures enum value "ADDRESS_FORMAT_TRON" AddressFormatTron AddressFormat = "ADDRESS_FORMAT_TRON" + + // AddressFormatSui captures enum value "ADDRESS_FORMAT_SUI" + AddressFormatSui AddressFormat = "ADDRESS_FORMAT_SUI" + + // AddressFormatAptos captures enum value "ADDRESS_FORMAT_APTOS" + AddressFormatAptos AddressFormat = "ADDRESS_FORMAT_APTOS" + + // AddressFormatBitcoinMainnetP2pkh captures enum value "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH" + AddressFormatBitcoinMainnetP2pkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH" + + // AddressFormatBitcoinMainnetP2sh captures enum value "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH" + AddressFormatBitcoinMainnetP2sh AddressFormat = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH" + + // AddressFormatBitcoinMainnetP2wpkh captures enum value "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH" + AddressFormatBitcoinMainnetP2wpkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH" + + // AddressFormatBitcoinMainnetP2wsh captures enum value "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH" + AddressFormatBitcoinMainnetP2wsh AddressFormat = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH" + + // AddressFormatBitcoinMainnetP2tr captures enum value "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR" + AddressFormatBitcoinMainnetP2tr AddressFormat = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR" + + // AddressFormatBitcoinTestnetP2pkh captures enum value "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH" + AddressFormatBitcoinTestnetP2pkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH" + + // AddressFormatBitcoinTestnetP2sh captures enum value "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH" + AddressFormatBitcoinTestnetP2sh AddressFormat = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH" + + // AddressFormatBitcoinTestnetP2wpkh captures enum value "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH" + AddressFormatBitcoinTestnetP2wpkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH" + + // AddressFormatBitcoinTestnetP2wsh captures enum value "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH" + AddressFormatBitcoinTestnetP2wsh AddressFormat = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH" + + // AddressFormatBitcoinTestnetP2tr captures enum value "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR" + AddressFormatBitcoinTestnetP2tr AddressFormat = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR" + + // AddressFormatBitcoinSignetP2pkh captures enum value "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH" + AddressFormatBitcoinSignetP2pkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH" + + // AddressFormatBitcoinSignetP2sh captures enum value "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH" + AddressFormatBitcoinSignetP2sh AddressFormat = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH" + + // AddressFormatBitcoinSignetP2wpkh captures enum value "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH" + AddressFormatBitcoinSignetP2wpkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH" + + // AddressFormatBitcoinSignetP2wsh captures enum value "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH" + AddressFormatBitcoinSignetP2wsh AddressFormat = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH" + + // AddressFormatBitcoinSignetP2tr captures enum value "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR" + AddressFormatBitcoinSignetP2tr AddressFormat = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR" + + // AddressFormatBitcoinRegtestP2pkh captures enum value "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH" + AddressFormatBitcoinRegtestP2pkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH" + + // AddressFormatBitcoinRegtestP2sh captures enum value "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH" + AddressFormatBitcoinRegtestP2sh AddressFormat = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH" + + // AddressFormatBitcoinRegtestP2wpkh captures enum value "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH" + AddressFormatBitcoinRegtestP2wpkh AddressFormat = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH" + + // AddressFormatBitcoinRegtestP2wsh captures enum value "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH" + AddressFormatBitcoinRegtestP2wsh AddressFormat = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH" + + // AddressFormatBitcoinRegtestP2tr captures enum value "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" + AddressFormatBitcoinRegtestP2tr AddressFormat = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" ) // for schema @@ -54,7 +120,7 @@ var AddressFormatEnum []AddressFormat func init() { var res []AddressFormat - if err := json.Unmarshal([]byte(`["ADDRESS_FORMAT_UNCOMPRESSED","ADDRESS_FORMAT_COMPRESSED","ADDRESS_FORMAT_ETHEREUM","ADDRESS_FORMAT_SOLANA","ADDRESS_FORMAT_COSMOS","ADDRESS_FORMAT_TRON"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["ADDRESS_FORMAT_UNCOMPRESSED","ADDRESS_FORMAT_COMPRESSED","ADDRESS_FORMAT_ETHEREUM","ADDRESS_FORMAT_SOLANA","ADDRESS_FORMAT_COSMOS","ADDRESS_FORMAT_TRON","ADDRESS_FORMAT_SUI","ADDRESS_FORMAT_APTOS","ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH","ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH","ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH","ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH","ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR","ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH","ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH","ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH","ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH","ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR","ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH","ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH","ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH","ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH","ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR","ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH","ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH","ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH","ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH","ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/api/models/create_read_write_session_intent_v2.go b/pkg/api/models/create_read_write_session_intent_v2.go index 16598ca..b7ab168 100644 --- a/pkg/api/models/create_read_write_session_intent_v2.go +++ b/pkg/api/models/create_read_write_session_intent_v2.go @@ -30,8 +30,7 @@ type CreateReadWriteSessionIntentV2 struct { TargetPublicKey *string `json:"targetPublicKey"` // Unique identifier for a given User. - // Required: true - UserID *string `json:"userId"` + UserID string `json:"userId,omitempty"` } // Validate validates this create read write session intent v2 @@ -42,10 +41,6 @@ func (m *CreateReadWriteSessionIntentV2) Validate(formats strfmt.Registry) error res = append(res, err) } - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -61,15 +56,6 @@ func (m *CreateReadWriteSessionIntentV2) validateTargetPublicKey(formats strfmt. return nil } -func (m *CreateReadWriteSessionIntentV2) validateUserID(formats strfmt.Registry) error { - - if err := validate.Required("userId", "body", m.UserID); err != nil { - return err - } - - return nil -} - // ContextValidate validates this create read write session intent v2 based on context it is used func (m *CreateReadWriteSessionIntentV2) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/pkg/api/models/delete_sub_organization_intent.go b/pkg/api/models/delete_sub_organization_intent.go new file mode 100644 index 0000000..5d2dc6d --- /dev/null +++ b/pkg/api/models/delete_sub_organization_intent.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeleteSubOrganizationIntent delete sub organization intent +// +// swagger:model DeleteSubOrganizationIntent +type DeleteSubOrganizationIntent struct { + + // Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false. + DeleteWithoutExport bool `json:"deleteWithoutExport,omitempty"` +} + +// Validate validates this delete sub organization intent +func (m *DeleteSubOrganizationIntent) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this delete sub organization intent based on context it is used +func (m *DeleteSubOrganizationIntent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteSubOrganizationIntent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteSubOrganizationIntent) UnmarshalBinary(b []byte) error { + var res DeleteSubOrganizationIntent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_sub_organization_request.go b/pkg/api/models/delete_sub_organization_request.go new file mode 100644 index 0000000..7e8bb46 --- /dev/null +++ b/pkg/api/models/delete_sub_organization_request.go @@ -0,0 +1,192 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeleteSubOrganizationRequest delete sub organization request +// +// swagger:model DeleteSubOrganizationRequest +type DeleteSubOrganizationRequest struct { + + // Unique identifier for a given Organization. + // Required: true + OrganizationID *string `json:"organizationId"` + + // parameters + // Required: true + Parameters *DeleteSubOrganizationIntent `json:"parameters"` + + // Timestamp (in milliseconds) of the request, used to verify liveness of user requests. + // Required: true + TimestampMs *string `json:"timestampMs"` + + // type + // Required: true + // Enum: [ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION] + Type *string `json:"type"` +} + +// Validate validates this delete sub organization request +func (m *DeleteSubOrganizationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOrganizationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParameters(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimestampMs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteSubOrganizationRequest) validateOrganizationID(formats strfmt.Registry) error { + + if err := validate.Required("organizationId", "body", m.OrganizationID); err != nil { + return err + } + + return nil +} + +func (m *DeleteSubOrganizationRequest) validateParameters(formats strfmt.Registry) error { + + if err := validate.Required("parameters", "body", m.Parameters); err != nil { + return err + } + + if m.Parameters != nil { + if err := m.Parameters.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameters") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameters") + } + return err + } + } + + return nil +} + +func (m *DeleteSubOrganizationRequest) validateTimestampMs(formats strfmt.Registry) error { + + if err := validate.Required("timestampMs", "body", m.TimestampMs); err != nil { + return err + } + + return nil +} + +var deleteSubOrganizationRequestTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deleteSubOrganizationRequestTypeTypePropEnum = append(deleteSubOrganizationRequestTypeTypePropEnum, v) + } +} + +const ( + + // DeleteSubOrganizationRequestTypeACTIVITYTYPEDELETESUBORGANIZATION captures enum value "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" + DeleteSubOrganizationRequestTypeACTIVITYTYPEDELETESUBORGANIZATION string = "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" +) + +// prop value enum +func (m *DeleteSubOrganizationRequest) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deleteSubOrganizationRequestTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeleteSubOrganizationRequest) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this delete sub organization request based on the context it is used +func (m *DeleteSubOrganizationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateParameters(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteSubOrganizationRequest) contextValidateParameters(ctx context.Context, formats strfmt.Registry) error { + + if m.Parameters != nil { + + if err := m.Parameters.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parameters") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parameters") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteSubOrganizationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteSubOrganizationRequest) UnmarshalBinary(b []byte) error { + var res DeleteSubOrganizationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_sub_organization_result.go b/pkg/api/models/delete_sub_organization_result.go new file mode 100644 index 0000000..e05d24b --- /dev/null +++ b/pkg/api/models/delete_sub_organization_result.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeleteSubOrganizationResult delete sub organization result +// +// swagger:model DeleteSubOrganizationResult +type DeleteSubOrganizationResult struct { + + // Unique identifier of the sub organization that was removed + // Required: true + SubOrganizationUUID *string `json:"subOrganizationUuid"` +} + +// Validate validates this delete sub organization result +func (m *DeleteSubOrganizationResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSubOrganizationUUID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteSubOrganizationResult) validateSubOrganizationUUID(formats strfmt.Registry) error { + + if err := validate.Required("subOrganizationUuid", "body", m.SubOrganizationUUID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this delete sub organization result based on context it is used +func (m *DeleteSubOrganizationResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteSubOrganizationResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteSubOrganizationResult) UnmarshalBinary(b []byte) error { + var res DeleteSubOrganizationResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/intent.go b/pkg/api/models/intent.go index 1c3e651..42baa8f 100644 --- a/pkg/api/models/intent.go +++ b/pkg/api/models/intent.go @@ -147,6 +147,9 @@ type Intent struct { // delete private keys intent DeletePrivateKeysIntent *DeletePrivateKeysIntent `json:"deletePrivateKeysIntent,omitempty"` + // delete sub organization intent + DeleteSubOrganizationIntent *DeleteSubOrganizationIntent `json:"deleteSubOrganizationIntent,omitempty"` + // delete user tags intent DeleteUserTagsIntent *DeleteUserTagsIntent `json:"deleteUserTagsIntent,omitempty"` @@ -416,6 +419,10 @@ func (m *Intent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeleteSubOrganizationIntent(formats); err != nil { + res = append(res, err) + } + if err := m.validateDeleteUserTagsIntent(formats); err != nil { res = append(res, err) } @@ -1348,6 +1355,25 @@ func (m *Intent) validateDeletePrivateKeysIntent(formats strfmt.Registry) error return nil } +func (m *Intent) validateDeleteSubOrganizationIntent(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteSubOrganizationIntent) { // not required + return nil + } + + if m.DeleteSubOrganizationIntent != nil { + if err := m.DeleteSubOrganizationIntent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteSubOrganizationIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteSubOrganizationIntent") + } + return err + } + } + + return nil +} + func (m *Intent) validateDeleteUserTagsIntent(formats strfmt.Registry) error { if swag.IsZero(m.DeleteUserTagsIntent) { // not required return nil @@ -2128,6 +2154,10 @@ func (m *Intent) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateDeleteSubOrganizationIntent(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDeleteUserTagsIntent(ctx, formats); err != nil { res = append(res, err) } @@ -3144,6 +3174,27 @@ func (m *Intent) contextValidateDeletePrivateKeysIntent(ctx context.Context, for return nil } +func (m *Intent) contextValidateDeleteSubOrganizationIntent(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteSubOrganizationIntent != nil { + + if swag.IsZero(m.DeleteSubOrganizationIntent) { // not required + return nil + } + + if err := m.DeleteSubOrganizationIntent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteSubOrganizationIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteSubOrganizationIntent") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateDeleteUserTagsIntent(ctx context.Context, formats strfmt.Registry) error { if m.DeleteUserTagsIntent != nil { diff --git a/pkg/api/models/result.go b/pkg/api/models/result.go index 22a0972..712dbb9 100644 --- a/pkg/api/models/result.go +++ b/pkg/api/models/result.go @@ -120,6 +120,9 @@ type Result struct { // delete private keys result DeletePrivateKeysResult *DeletePrivateKeysResult `json:"deletePrivateKeysResult,omitempty"` + // delete sub organization result + DeleteSubOrganizationResult *DeleteSubOrganizationResult `json:"deleteSubOrganizationResult,omitempty"` + // delete user tags result DeleteUserTagsResult *DeleteUserTagsResult `json:"deleteUserTagsResult,omitempty"` @@ -342,6 +345,10 @@ func (m *Result) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeleteSubOrganizationResult(formats); err != nil { + res = append(res, err) + } + if err := m.validateDeleteUserTagsResult(formats); err != nil { res = append(res, err) } @@ -1094,6 +1101,25 @@ func (m *Result) validateDeletePrivateKeysResult(formats strfmt.Registry) error return nil } +func (m *Result) validateDeleteSubOrganizationResult(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteSubOrganizationResult) { // not required + return nil + } + + if m.DeleteSubOrganizationResult != nil { + if err := m.DeleteSubOrganizationResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteSubOrganizationResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteSubOrganizationResult") + } + return err + } + } + + return nil +} + func (m *Result) validateDeleteUserTagsResult(formats strfmt.Registry) error { if swag.IsZero(m.DeleteUserTagsResult) { // not required return nil @@ -1709,6 +1735,10 @@ func (m *Result) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateDeleteSubOrganizationResult(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDeleteUserTagsResult(ctx, formats); err != nil { res = append(res, err) } @@ -2529,6 +2559,27 @@ func (m *Result) contextValidateDeletePrivateKeysResult(ctx context.Context, for return nil } +func (m *Result) contextValidateDeleteSubOrganizationResult(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteSubOrganizationResult != nil { + + if swag.IsZero(m.DeleteSubOrganizationResult) { // not required + return nil + } + + if err := m.DeleteSubOrganizationResult.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteSubOrganizationResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteSubOrganizationResult") + } + return err + } + } + + return nil +} + func (m *Result) contextValidateDeleteUserTagsResult(ctx context.Context, formats strfmt.Registry) error { if m.DeleteUserTagsResult != nil { diff --git a/pkg/api/models/transaction_type.go b/pkg/api/models/transaction_type.go index 8a04292..4b5810f 100644 --- a/pkg/api/models/transaction_type.go +++ b/pkg/api/models/transaction_type.go @@ -32,6 +32,9 @@ const ( // TransactionTypeEthereum captures enum value "TRANSACTION_TYPE_ETHEREUM" TransactionTypeEthereum TransactionType = "TRANSACTION_TYPE_ETHEREUM" + + // TransactionTypeSolana captures enum value "TRANSACTION_TYPE_SOLANA" + TransactionTypeSolana TransactionType = "TRANSACTION_TYPE_SOLANA" ) // for schema @@ -39,7 +42,7 @@ var TransactionTypeEnum []TransactionType func init() { var res []TransactionType - if err := json.Unmarshal([]byte(`["TRANSACTION_TYPE_ETHEREUM"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["TRANSACTION_TYPE_ETHEREUM","TRANSACTION_TYPE_SOLANA"]`), &res); err != nil { panic(err) } for _, v := range res { From 243683416eccd53c6c2c6177fc536dba37a6b3ef Mon Sep 17 00:00:00 2001 From: Andrew Min Date: Wed, 2 Oct 2024 18:05:37 -0400 Subject: [PATCH 2/2] update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1f1766d..1644e0b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ go install github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5 2. Update the swagger file in `api/` with a new one 3. Run `make generate` +Note: depending on how you downloaded, your `go-swagger` may be located in a few locations such as `/Users//go/bin/swagger` or `/opt/homebrew/bin/swagger`. If both are present, we would recommend using the former, for better version granularity + ### Custom Templates While custom templates should be avoided where possible, sometimes it's worth the extra maintenance burden to provide a more streamlined UX. To use a custom template, copy the original template from the [go-swagger repo](https://github.com/go-swagger/go-swagger) to the `templates` directory