diff --git a/api/public_api.swagger.json b/api/public_api.swagger.json index caecb22..d116262 100644 --- a/api/public_api.swagger.json +++ b/api/public_api.swagger.json @@ -1183,6 +1183,32 @@ "tags": ["Private Key Tags"] } }, + "/public/v1/submit/delete_private_keys": { + "post": { + "summary": "Delete organization private keys", + "description": "Deletes private keys for an organization", + "operationId": "DeletePrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeletePrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, "/public/v1/submit/delete_user_tags": { "post": { "summary": "Delete User Tags", @@ -1235,6 +1261,32 @@ "tags": ["Users"] } }, + "/public/v1/submit/delete_wallets": { + "post": { + "summary": "Delete organization wallets", + "description": "Deletes wallets for an organization", + "operationId": "DeleteWallets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeleteWalletsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, "/public/v1/submit/email_auth": { "post": { "summary": "Perform Email Auth", @@ -2049,7 +2101,9 @@ "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_CREATE_SUB_ORGANIZATION_V6", + "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", + "ACTIVITY_TYPE_DELETE_WALLETS" ] }, "AddressFormat": { @@ -4011,6 +4065,57 @@ }, "required": ["privateKeyTagIds", "privateKeyIds"] }, + "DeletePrivateKeysIntent": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for private keys within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["privateKeyIds"] + }, + "DeletePrivateKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_PRIVATE_KEYS"] + }, + "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/DeletePrivateKeysIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeletePrivateKeysResult": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of private key unique identifiers that were removed" + } + }, + "required": ["privateKeyIds"] + }, "DeleteUserTagsIntent": { "type": "object", "properties": { @@ -4112,6 +4217,57 @@ }, "required": ["userIds"] }, + "DeleteWalletsIntent": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for wallets within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["walletIds"] + }, + "DeleteWalletsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_WALLETS"] + }, + "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/DeleteWalletsIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "DeleteWalletsResult": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of wallet unique identifiers that were removed" + } + }, + "required": ["walletIds"] + }, "DisablePrivateKeyIntent": { "type": "object", "properties": { @@ -5427,6 +5583,12 @@ }, "createSubOrganizationIntentV6": { "$ref": "#/definitions/CreateSubOrganizationIntentV6" + }, + "deletePrivateKeysIntent": { + "$ref": "#/definitions/DeletePrivateKeysIntent" + }, + "deleteWalletsIntent": { + "$ref": "#/definitions/DeleteWalletsIntent" } } }, @@ -6165,6 +6327,12 @@ }, "createSubOrganizationResultV6": { "$ref": "#/definitions/CreateSubOrganizationResultV6" + }, + "deletePrivateKeysResult": { + "$ref": "#/definitions/DeletePrivateKeysResult" + }, + "deleteWalletsResult": { + "$ref": "#/definitions/DeleteWalletsResult" } } }, diff --git a/pkg/api/client/private_keys/delete_private_keys_parameters.go b/pkg/api/client/private_keys/delete_private_keys_parameters.go new file mode 100644 index 0000000..1d3352b --- /dev/null +++ b/pkg/api/client/private_keys/delete_private_keys_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package private_keys + +// 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" +) + +// NewDeletePrivateKeysParams creates a new DeletePrivateKeysParams 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 NewDeletePrivateKeysParams() *DeletePrivateKeysParams { + return &DeletePrivateKeysParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeletePrivateKeysParamsWithTimeout creates a new DeletePrivateKeysParams object +// with the ability to set a timeout on a request. +func NewDeletePrivateKeysParamsWithTimeout(timeout time.Duration) *DeletePrivateKeysParams { + return &DeletePrivateKeysParams{ + timeout: timeout, + } +} + +// NewDeletePrivateKeysParamsWithContext creates a new DeletePrivateKeysParams object +// with the ability to set a context for a request. +func NewDeletePrivateKeysParamsWithContext(ctx context.Context) *DeletePrivateKeysParams { + return &DeletePrivateKeysParams{ + Context: ctx, + } +} + +// NewDeletePrivateKeysParamsWithHTTPClient creates a new DeletePrivateKeysParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeletePrivateKeysParamsWithHTTPClient(client *http.Client) *DeletePrivateKeysParams { + return &DeletePrivateKeysParams{ + HTTPClient: client, + } +} + +/* +DeletePrivateKeysParams contains all the parameters to send to the API endpoint + + for the delete private keys operation. + + Typically these are written to a http.Request. +*/ +type DeletePrivateKeysParams struct { + + // Body. + Body *models.DeletePrivateKeysRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete private keys params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePrivateKeysParams) WithDefaults() *DeletePrivateKeysParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete private keys params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeletePrivateKeysParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete private keys params +func (o *DeletePrivateKeysParams) WithTimeout(timeout time.Duration) *DeletePrivateKeysParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete private keys params +func (o *DeletePrivateKeysParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete private keys params +func (o *DeletePrivateKeysParams) WithContext(ctx context.Context) *DeletePrivateKeysParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete private keys params +func (o *DeletePrivateKeysParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete private keys params +func (o *DeletePrivateKeysParams) WithHTTPClient(client *http.Client) *DeletePrivateKeysParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete private keys params +func (o *DeletePrivateKeysParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the delete private keys params +func (o *DeletePrivateKeysParams) WithBody(body *models.DeletePrivateKeysRequest) *DeletePrivateKeysParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the delete private keys params +func (o *DeletePrivateKeysParams) SetBody(body *models.DeletePrivateKeysRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *DeletePrivateKeysParams) 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/private_keys/delete_private_keys_responses.go b/pkg/api/client/private_keys/delete_private_keys_responses.go new file mode 100644 index 0000000..687de94 --- /dev/null +++ b/pkg/api/client/private_keys/delete_private_keys_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package private_keys + +// 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" +) + +// DeletePrivateKeysReader is a Reader for the DeletePrivateKeys structure. +type DeletePrivateKeysReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeletePrivateKeysReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeletePrivateKeysOK() + 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_private_keys] DeletePrivateKeys", response, response.Code()) + } +} + +// NewDeletePrivateKeysOK creates a DeletePrivateKeysOK with default headers values +func NewDeletePrivateKeysOK() *DeletePrivateKeysOK { + return &DeletePrivateKeysOK{} +} + +/* +DeletePrivateKeysOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type DeletePrivateKeysOK struct { + Payload *models.ActivityResponse +} + +// IsSuccess returns true when this delete private keys o k response has a 2xx status code +func (o *DeletePrivateKeysOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete private keys o k response has a 3xx status code +func (o *DeletePrivateKeysOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete private keys o k response has a 4xx status code +func (o *DeletePrivateKeysOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete private keys o k response has a 5xx status code +func (o *DeletePrivateKeysOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete private keys o k response a status code equal to that given +func (o *DeletePrivateKeysOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete private keys o k response +func (o *DeletePrivateKeysOK) Code() int { + return 200 +} + +func (o *DeletePrivateKeysOK) Error() string { + return fmt.Sprintf("[POST /public/v1/submit/delete_private_keys][%d] deletePrivateKeysOK %+v", 200, o.Payload) +} + +func (o *DeletePrivateKeysOK) String() string { + return fmt.Sprintf("[POST /public/v1/submit/delete_private_keys][%d] deletePrivateKeysOK %+v", 200, o.Payload) +} + +func (o *DeletePrivateKeysOK) GetPayload() *models.ActivityResponse { + return o.Payload +} + +func (o *DeletePrivateKeysOK) 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/private_keys/private_keys_client.go b/pkg/api/client/private_keys/private_keys_client.go index b19d0b1..6b9a121 100644 --- a/pkg/api/client/private_keys/private_keys_client.go +++ b/pkg/api/client/private_keys/private_keys_client.go @@ -32,6 +32,8 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { CreatePrivateKeys(params *CreatePrivateKeysParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePrivateKeysOK, error) + DeletePrivateKeys(params *DeletePrivateKeysParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePrivateKeysOK, error) + ExportPrivateKey(params *ExportPrivateKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportPrivateKeyOK, error) GetPrivateKey(params *GetPrivateKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPrivateKeyOK, error) @@ -86,6 +88,47 @@ func (a *Client) CreatePrivateKeys(params *CreatePrivateKeysParams, authInfo run panic(msg) } +/* +DeletePrivateKeys deletes organization private keys + +Deletes private keys for an organization +*/ +func (a *Client) DeletePrivateKeys(params *DeletePrivateKeysParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePrivateKeysOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeletePrivateKeysParams() + } + op := &runtime.ClientOperation{ + ID: "DeletePrivateKeys", + Method: "POST", + PathPattern: "/public/v1/submit/delete_private_keys", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeletePrivateKeysReader{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.(*DeletePrivateKeysOK) + 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 DeletePrivateKeys: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ExportPrivateKey exports private key diff --git a/pkg/api/client/wallets/delete_wallets_parameters.go b/pkg/api/client/wallets/delete_wallets_parameters.go new file mode 100644 index 0000000..2916bb5 --- /dev/null +++ b/pkg/api/client/wallets/delete_wallets_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package wallets + +// 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" +) + +// NewDeleteWalletsParams creates a new DeleteWalletsParams 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 NewDeleteWalletsParams() *DeleteWalletsParams { + return &DeleteWalletsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteWalletsParamsWithTimeout creates a new DeleteWalletsParams object +// with the ability to set a timeout on a request. +func NewDeleteWalletsParamsWithTimeout(timeout time.Duration) *DeleteWalletsParams { + return &DeleteWalletsParams{ + timeout: timeout, + } +} + +// NewDeleteWalletsParamsWithContext creates a new DeleteWalletsParams object +// with the ability to set a context for a request. +func NewDeleteWalletsParamsWithContext(ctx context.Context) *DeleteWalletsParams { + return &DeleteWalletsParams{ + Context: ctx, + } +} + +// NewDeleteWalletsParamsWithHTTPClient creates a new DeleteWalletsParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteWalletsParamsWithHTTPClient(client *http.Client) *DeleteWalletsParams { + return &DeleteWalletsParams{ + HTTPClient: client, + } +} + +/* +DeleteWalletsParams contains all the parameters to send to the API endpoint + + for the delete wallets operation. + + Typically these are written to a http.Request. +*/ +type DeleteWalletsParams struct { + + // Body. + Body *models.DeleteWalletsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete wallets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteWalletsParams) WithDefaults() *DeleteWalletsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete wallets params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteWalletsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete wallets params +func (o *DeleteWalletsParams) WithTimeout(timeout time.Duration) *DeleteWalletsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete wallets params +func (o *DeleteWalletsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete wallets params +func (o *DeleteWalletsParams) WithContext(ctx context.Context) *DeleteWalletsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete wallets params +func (o *DeleteWalletsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete wallets params +func (o *DeleteWalletsParams) WithHTTPClient(client *http.Client) *DeleteWalletsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete wallets params +func (o *DeleteWalletsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the delete wallets params +func (o *DeleteWalletsParams) WithBody(body *models.DeleteWalletsRequest) *DeleteWalletsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the delete wallets params +func (o *DeleteWalletsParams) SetBody(body *models.DeleteWalletsRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteWalletsParams) 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/wallets/delete_wallets_responses.go b/pkg/api/client/wallets/delete_wallets_responses.go new file mode 100644 index 0000000..8c6d5e7 --- /dev/null +++ b/pkg/api/client/wallets/delete_wallets_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package wallets + +// 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" +) + +// DeleteWalletsReader is a Reader for the DeleteWallets structure. +type DeleteWalletsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteWalletsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteWalletsOK() + 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_wallets] DeleteWallets", response, response.Code()) + } +} + +// NewDeleteWalletsOK creates a DeleteWalletsOK with default headers values +func NewDeleteWalletsOK() *DeleteWalletsOK { + return &DeleteWalletsOK{} +} + +/* +DeleteWalletsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type DeleteWalletsOK struct { + Payload *models.ActivityResponse +} + +// IsSuccess returns true when this delete wallets o k response has a 2xx status code +func (o *DeleteWalletsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete wallets o k response has a 3xx status code +func (o *DeleteWalletsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete wallets o k response has a 4xx status code +func (o *DeleteWalletsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete wallets o k response has a 5xx status code +func (o *DeleteWalletsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete wallets o k response a status code equal to that given +func (o *DeleteWalletsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete wallets o k response +func (o *DeleteWalletsOK) Code() int { + return 200 +} + +func (o *DeleteWalletsOK) Error() string { + return fmt.Sprintf("[POST /public/v1/submit/delete_wallets][%d] deleteWalletsOK %+v", 200, o.Payload) +} + +func (o *DeleteWalletsOK) String() string { + return fmt.Sprintf("[POST /public/v1/submit/delete_wallets][%d] deleteWalletsOK %+v", 200, o.Payload) +} + +func (o *DeleteWalletsOK) GetPayload() *models.ActivityResponse { + return o.Payload +} + +func (o *DeleteWalletsOK) 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/wallets/wallets_client.go b/pkg/api/client/wallets/wallets_client.go index d032d50..7d84622 100644 --- a/pkg/api/client/wallets/wallets_client.go +++ b/pkg/api/client/wallets/wallets_client.go @@ -34,6 +34,8 @@ type ClientService interface { CreateWalletAccounts(params *CreateWalletAccountsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateWalletAccountsOK, error) + DeleteWallets(params *DeleteWalletsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteWalletsOK, error) + ExportWallet(params *ExportWalletParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportWalletOK, error) ExportWalletAccount(params *ExportWalletAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExportWalletAccountOK, error) @@ -133,6 +135,47 @@ func (a *Client) CreateWalletAccounts(params *CreateWalletAccountsParams, authIn panic(msg) } +/* +DeleteWallets deletes organization wallets + +Deletes wallets for an organization +*/ +func (a *Client) DeleteWallets(params *DeleteWalletsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteWalletsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteWalletsParams() + } + op := &runtime.ClientOperation{ + ID: "DeleteWallets", + Method: "POST", + PathPattern: "/public/v1/submit/delete_wallets", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &DeleteWalletsReader{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.(*DeleteWalletsOK) + 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 DeleteWallets: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* ExportWallet exports wallet diff --git a/pkg/api/models/activity_type.go b/pkg/api/models/activity_type.go index 0628c3f..d0878ff 100644 --- a/pkg/api/models/activity_type.go +++ b/pkg/api/models/activity_type.go @@ -245,6 +245,12 @@ const ( // ActivityTypeCreateSubOrganizationV6 captures enum value "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6" ActivityTypeCreateSubOrganizationV6 ActivityType = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6" + + // ActivityTypeDeletePrivateKeys captures enum value "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" + ActivityTypeDeletePrivateKeys ActivityType = "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" + + // ActivityTypeDeleteWallets captures enum value "ACTIVITY_TYPE_DELETE_WALLETS" + ActivityTypeDeleteWallets ActivityType = "ACTIVITY_TYPE_DELETE_WALLETS" ) // for schema @@ -252,7 +258,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"]`), &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"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/api/models/delete_private_keys_intent.go b/pkg/api/models/delete_private_keys_intent.go new file mode 100644 index 0000000..4750cdf --- /dev/null +++ b/pkg/api/models/delete_private_keys_intent.go @@ -0,0 +1,74 @@ +// 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" +) + +// DeletePrivateKeysIntent delete private keys intent +// +// swagger:model DeletePrivateKeysIntent +type DeletePrivateKeysIntent struct { + + // Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored. + DeleteWithoutExport bool `json:"deleteWithoutExport,omitempty"` + + // List of unique identifiers for private keys within an organization + // Required: true + PrivateKeyIds []string `json:"privateKeyIds"` +} + +// Validate validates this delete private keys intent +func (m *DeletePrivateKeysIntent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrivateKeyIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeletePrivateKeysIntent) validatePrivateKeyIds(formats strfmt.Registry) error { + + if err := validate.Required("privateKeyIds", "body", m.PrivateKeyIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this delete private keys intent based on context it is used +func (m *DeletePrivateKeysIntent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeletePrivateKeysIntent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeletePrivateKeysIntent) UnmarshalBinary(b []byte) error { + var res DeletePrivateKeysIntent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_private_keys_request.go b/pkg/api/models/delete_private_keys_request.go new file mode 100644 index 0000000..8df53b0 --- /dev/null +++ b/pkg/api/models/delete_private_keys_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" +) + +// DeletePrivateKeysRequest delete private keys request +// +// swagger:model DeletePrivateKeysRequest +type DeletePrivateKeysRequest struct { + + // Unique identifier for a given Organization. + // Required: true + OrganizationID *string `json:"organizationId"` + + // parameters + // Required: true + Parameters *DeletePrivateKeysIntent `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_PRIVATE_KEYS] + Type *string `json:"type"` +} + +// Validate validates this delete private keys request +func (m *DeletePrivateKeysRequest) 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 *DeletePrivateKeysRequest) validateOrganizationID(formats strfmt.Registry) error { + + if err := validate.Required("organizationId", "body", m.OrganizationID); err != nil { + return err + } + + return nil +} + +func (m *DeletePrivateKeysRequest) 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 *DeletePrivateKeysRequest) validateTimestampMs(formats strfmt.Registry) error { + + if err := validate.Required("timestampMs", "body", m.TimestampMs); err != nil { + return err + } + + return nil +} + +var deletePrivateKeysRequestTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_DELETE_PRIVATE_KEYS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deletePrivateKeysRequestTypeTypePropEnum = append(deletePrivateKeysRequestTypeTypePropEnum, v) + } +} + +const ( + + // DeletePrivateKeysRequestTypeACTIVITYTYPEDELETEPRIVATEKEYS captures enum value "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" + DeletePrivateKeysRequestTypeACTIVITYTYPEDELETEPRIVATEKEYS string = "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" +) + +// prop value enum +func (m *DeletePrivateKeysRequest) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deletePrivateKeysRequestTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeletePrivateKeysRequest) 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 private keys request based on the context it is used +func (m *DeletePrivateKeysRequest) 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 *DeletePrivateKeysRequest) 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 *DeletePrivateKeysRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeletePrivateKeysRequest) UnmarshalBinary(b []byte) error { + var res DeletePrivateKeysRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_private_keys_result.go b/pkg/api/models/delete_private_keys_result.go new file mode 100644 index 0000000..d2eec6d --- /dev/null +++ b/pkg/api/models/delete_private_keys_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" +) + +// DeletePrivateKeysResult delete private keys result +// +// swagger:model DeletePrivateKeysResult +type DeletePrivateKeysResult struct { + + // A list of private key unique identifiers that were removed + // Required: true + PrivateKeyIds []string `json:"privateKeyIds"` +} + +// Validate validates this delete private keys result +func (m *DeletePrivateKeysResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrivateKeyIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeletePrivateKeysResult) validatePrivateKeyIds(formats strfmt.Registry) error { + + if err := validate.Required("privateKeyIds", "body", m.PrivateKeyIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this delete private keys result based on context it is used +func (m *DeletePrivateKeysResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeletePrivateKeysResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeletePrivateKeysResult) UnmarshalBinary(b []byte) error { + var res DeletePrivateKeysResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_wallets_intent.go b/pkg/api/models/delete_wallets_intent.go new file mode 100644 index 0000000..1ad58e8 --- /dev/null +++ b/pkg/api/models/delete_wallets_intent.go @@ -0,0 +1,74 @@ +// 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" +) + +// DeleteWalletsIntent delete wallets intent +// +// swagger:model DeleteWalletsIntent +type DeleteWalletsIntent struct { + + // Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored. + DeleteWithoutExport bool `json:"deleteWithoutExport,omitempty"` + + // List of unique identifiers for wallets within an organization + // Required: true + WalletIds []string `json:"walletIds"` +} + +// Validate validates this delete wallets intent +func (m *DeleteWalletsIntent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWalletIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteWalletsIntent) validateWalletIds(formats strfmt.Registry) error { + + if err := validate.Required("walletIds", "body", m.WalletIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this delete wallets intent based on context it is used +func (m *DeleteWalletsIntent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteWalletsIntent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteWalletsIntent) UnmarshalBinary(b []byte) error { + var res DeleteWalletsIntent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_wallets_request.go b/pkg/api/models/delete_wallets_request.go new file mode 100644 index 0000000..6d2e42f --- /dev/null +++ b/pkg/api/models/delete_wallets_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" +) + +// DeleteWalletsRequest delete wallets request +// +// swagger:model DeleteWalletsRequest +type DeleteWalletsRequest struct { + + // Unique identifier for a given Organization. + // Required: true + OrganizationID *string `json:"organizationId"` + + // parameters + // Required: true + Parameters *DeleteWalletsIntent `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_WALLETS] + Type *string `json:"type"` +} + +// Validate validates this delete wallets request +func (m *DeleteWalletsRequest) 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 *DeleteWalletsRequest) validateOrganizationID(formats strfmt.Registry) error { + + if err := validate.Required("organizationId", "body", m.OrganizationID); err != nil { + return err + } + + return nil +} + +func (m *DeleteWalletsRequest) 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 *DeleteWalletsRequest) validateTimestampMs(formats strfmt.Registry) error { + + if err := validate.Required("timestampMs", "body", m.TimestampMs); err != nil { + return err + } + + return nil +} + +var deleteWalletsRequestTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_DELETE_WALLETS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deleteWalletsRequestTypeTypePropEnum = append(deleteWalletsRequestTypeTypePropEnum, v) + } +} + +const ( + + // DeleteWalletsRequestTypeACTIVITYTYPEDELETEWALLETS captures enum value "ACTIVITY_TYPE_DELETE_WALLETS" + DeleteWalletsRequestTypeACTIVITYTYPEDELETEWALLETS string = "ACTIVITY_TYPE_DELETE_WALLETS" +) + +// prop value enum +func (m *DeleteWalletsRequest) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, deleteWalletsRequestTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *DeleteWalletsRequest) 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 wallets request based on the context it is used +func (m *DeleteWalletsRequest) 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 *DeleteWalletsRequest) 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 *DeleteWalletsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteWalletsRequest) UnmarshalBinary(b []byte) error { + var res DeleteWalletsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/delete_wallets_result.go b/pkg/api/models/delete_wallets_result.go new file mode 100644 index 0000000..77db208 --- /dev/null +++ b/pkg/api/models/delete_wallets_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" +) + +// DeleteWalletsResult delete wallets result +// +// swagger:model DeleteWalletsResult +type DeleteWalletsResult struct { + + // A list of wallet unique identifiers that were removed + // Required: true + WalletIds []string `json:"walletIds"` +} + +// Validate validates this delete wallets result +func (m *DeleteWalletsResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWalletIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeleteWalletsResult) validateWalletIds(formats strfmt.Registry) error { + + if err := validate.Required("walletIds", "body", m.WalletIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this delete wallets result based on context it is used +func (m *DeleteWalletsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DeleteWalletsResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeleteWalletsResult) UnmarshalBinary(b []byte) error { + var res DeleteWalletsResult + 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 5b274e6..357299c 100644 --- a/pkg/api/models/intent.go +++ b/pkg/api/models/intent.go @@ -141,12 +141,18 @@ type Intent struct { // delete private key tags intent DeletePrivateKeyTagsIntent *DeletePrivateKeyTagsIntent `json:"deletePrivateKeyTagsIntent,omitempty"` + // delete private keys intent + DeletePrivateKeysIntent *DeletePrivateKeysIntent `json:"deletePrivateKeysIntent,omitempty"` + // delete user tags intent DeleteUserTagsIntent *DeleteUserTagsIntent `json:"deleteUserTagsIntent,omitempty"` // delete users intent DeleteUsersIntent *DeleteUsersIntent `json:"deleteUsersIntent,omitempty"` + // delete wallets intent + DeleteWalletsIntent *DeleteWalletsIntent `json:"deleteWalletsIntent,omitempty"` + // disable private key intent DisablePrivateKeyIntent *DisablePrivateKeyIntent `json:"disablePrivateKeyIntent,omitempty"` @@ -399,6 +405,10 @@ func (m *Intent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeletePrivateKeysIntent(formats); err != nil { + res = append(res, err) + } + if err := m.validateDeleteUserTagsIntent(formats); err != nil { res = append(res, err) } @@ -407,6 +417,10 @@ func (m *Intent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeleteWalletsIntent(formats); err != nil { + res = append(res, err) + } + if err := m.validateDisablePrivateKeyIntent(formats); err != nil { res = append(res, err) } @@ -1289,6 +1303,25 @@ func (m *Intent) validateDeletePrivateKeyTagsIntent(formats strfmt.Registry) err return nil } +func (m *Intent) validateDeletePrivateKeysIntent(formats strfmt.Registry) error { + if swag.IsZero(m.DeletePrivateKeysIntent) { // not required + return nil + } + + if m.DeletePrivateKeysIntent != nil { + if err := m.DeletePrivateKeysIntent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deletePrivateKeysIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deletePrivateKeysIntent") + } + return err + } + } + + return nil +} + func (m *Intent) validateDeleteUserTagsIntent(formats strfmt.Registry) error { if swag.IsZero(m.DeleteUserTagsIntent) { // not required return nil @@ -1327,6 +1360,25 @@ func (m *Intent) validateDeleteUsersIntent(formats strfmt.Registry) error { return nil } +func (m *Intent) validateDeleteWalletsIntent(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteWalletsIntent) { // not required + return nil + } + + if m.DeleteWalletsIntent != nil { + if err := m.DeleteWalletsIntent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteWalletsIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteWalletsIntent") + } + return err + } + } + + return nil +} + func (m *Intent) validateDisablePrivateKeyIntent(formats strfmt.Registry) error { if swag.IsZero(m.DisablePrivateKeyIntent) { // not required return nil @@ -2042,6 +2094,10 @@ func (m *Intent) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateDeletePrivateKeysIntent(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDeleteUserTagsIntent(ctx, formats); err != nil { res = append(res, err) } @@ -2050,6 +2106,10 @@ func (m *Intent) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateDeleteWalletsIntent(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisablePrivateKeyIntent(ctx, formats); err != nil { res = append(res, err) } @@ -3012,6 +3072,27 @@ func (m *Intent) contextValidateDeletePrivateKeyTagsIntent(ctx context.Context, return nil } +func (m *Intent) contextValidateDeletePrivateKeysIntent(ctx context.Context, formats strfmt.Registry) error { + + if m.DeletePrivateKeysIntent != nil { + + if swag.IsZero(m.DeletePrivateKeysIntent) { // not required + return nil + } + + if err := m.DeletePrivateKeysIntent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deletePrivateKeysIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deletePrivateKeysIntent") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateDeleteUserTagsIntent(ctx context.Context, formats strfmt.Registry) error { if m.DeleteUserTagsIntent != nil { @@ -3054,6 +3135,27 @@ func (m *Intent) contextValidateDeleteUsersIntent(ctx context.Context, formats s return nil } +func (m *Intent) contextValidateDeleteWalletsIntent(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteWalletsIntent != nil { + + if swag.IsZero(m.DeleteWalletsIntent) { // not required + return nil + } + + if err := m.DeleteWalletsIntent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteWalletsIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteWalletsIntent") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateDisablePrivateKeyIntent(ctx context.Context, formats strfmt.Registry) error { if m.DisablePrivateKeyIntent != nil { diff --git a/pkg/api/models/result.go b/pkg/api/models/result.go index 5450159..2df37d5 100644 --- a/pkg/api/models/result.go +++ b/pkg/api/models/result.go @@ -114,12 +114,18 @@ type Result struct { // delete private key tags result DeletePrivateKeyTagsResult *DeletePrivateKeyTagsResult `json:"deletePrivateKeyTagsResult,omitempty"` + // delete private keys result + DeletePrivateKeysResult *DeletePrivateKeysResult `json:"deletePrivateKeysResult,omitempty"` + // delete user tags result DeleteUserTagsResult *DeleteUserTagsResult `json:"deleteUserTagsResult,omitempty"` // delete users result DeleteUsersResult *DeleteUsersResult `json:"deleteUsersResult,omitempty"` + // delete wallets result + DeleteWalletsResult *DeleteWalletsResult `json:"deleteWalletsResult,omitempty"` + // disable private key result DisablePrivateKeyResult *DisablePrivateKeyResult `json:"disablePrivateKeyResult,omitempty"` @@ -325,6 +331,10 @@ func (m *Result) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeletePrivateKeysResult(formats); err != nil { + res = append(res, err) + } + if err := m.validateDeleteUserTagsResult(formats); err != nil { res = append(res, err) } @@ -333,6 +343,10 @@ func (m *Result) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateDeleteWalletsResult(formats); err != nil { + res = append(res, err) + } + if err := m.validateDisablePrivateKeyResult(formats); err != nil { res = append(res, err) } @@ -1035,6 +1049,25 @@ func (m *Result) validateDeletePrivateKeyTagsResult(formats strfmt.Registry) err return nil } +func (m *Result) validateDeletePrivateKeysResult(formats strfmt.Registry) error { + if swag.IsZero(m.DeletePrivateKeysResult) { // not required + return nil + } + + if m.DeletePrivateKeysResult != nil { + if err := m.DeletePrivateKeysResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deletePrivateKeysResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deletePrivateKeysResult") + } + return err + } + } + + return nil +} + func (m *Result) validateDeleteUserTagsResult(formats strfmt.Registry) error { if swag.IsZero(m.DeleteUserTagsResult) { // not required return nil @@ -1073,6 +1106,25 @@ func (m *Result) validateDeleteUsersResult(formats strfmt.Registry) error { return nil } +func (m *Result) validateDeleteWalletsResult(formats strfmt.Registry) error { + if swag.IsZero(m.DeleteWalletsResult) { // not required + return nil + } + + if m.DeleteWalletsResult != nil { + if err := m.DeleteWalletsResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteWalletsResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteWalletsResult") + } + return err + } + } + + return nil +} + func (m *Result) validateDisablePrivateKeyResult(formats strfmt.Registry) error { if swag.IsZero(m.DisablePrivateKeyResult) { // not required return nil @@ -1623,6 +1675,10 @@ func (m *Result) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateDeletePrivateKeysResult(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDeleteUserTagsResult(ctx, formats); err != nil { res = append(res, err) } @@ -1631,6 +1687,10 @@ func (m *Result) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateDeleteWalletsResult(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateDisablePrivateKeyResult(ctx, formats); err != nil { res = append(res, err) } @@ -2397,6 +2457,27 @@ func (m *Result) contextValidateDeletePrivateKeyTagsResult(ctx context.Context, return nil } +func (m *Result) contextValidateDeletePrivateKeysResult(ctx context.Context, formats strfmt.Registry) error { + + if m.DeletePrivateKeysResult != nil { + + if swag.IsZero(m.DeletePrivateKeysResult) { // not required + return nil + } + + if err := m.DeletePrivateKeysResult.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deletePrivateKeysResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deletePrivateKeysResult") + } + return err + } + } + + return nil +} + func (m *Result) contextValidateDeleteUserTagsResult(ctx context.Context, formats strfmt.Registry) error { if m.DeleteUserTagsResult != nil { @@ -2439,6 +2520,27 @@ func (m *Result) contextValidateDeleteUsersResult(ctx context.Context, formats s return nil } +func (m *Result) contextValidateDeleteWalletsResult(ctx context.Context, formats strfmt.Registry) error { + + if m.DeleteWalletsResult != nil { + + if swag.IsZero(m.DeleteWalletsResult) { // not required + return nil + } + + if err := m.DeleteWalletsResult.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deleteWalletsResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deleteWalletsResult") + } + return err + } + } + + return nil +} + func (m *Result) contextValidateDisablePrivateKeyResult(ctx context.Context, formats strfmt.Registry) error { if m.DisablePrivateKeyResult != nil {