diff --git a/api/public_api.swagger.json b/api/public_api.swagger.json index 2af6520..d67676f 100644 --- a/api/public_api.swagger.json +++ b/api/public_api.swagger.json @@ -403,6 +403,32 @@ "tags": ["Private Keys"] } }, + "/public/v1/query/list_suborgs": { + "post": { + "summary": "Get Suborgs", + "description": "Get all suborg IDs associated given a parent org ID and an optional filter.", + "operationId": "GetSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/GetSubOrgIdsResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GetSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, "/public/v1/query/list_user_tags": { "post": { "summary": "List User Tags", @@ -1131,6 +1157,32 @@ "tags": ["Wallets"] } }, + "/public/v1/submit/import_private_key": { + "post": { + "summary": "Import Private Key", + "description": "Imports a private key", + "operationId": "ImportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ImportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, "/public/v1/submit/import_wallet": { "post": { "summary": "Import Wallet", @@ -1157,6 +1209,32 @@ "tags": ["Wallets"] } }, + "/public/v1/submit/init_import_private_key": { + "post": { + "summary": "Init Import Private Key", + "description": "Initializes a new private key import", + "operationId": "InitImportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/ActivityResponse" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/InitImportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, "/public/v1/submit/init_import_wallet": { "post": { "summary": "Init Import Wallet", @@ -1720,7 +1798,9 @@ "ACTIVITY_TYPE_EMAIL_AUTH", "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", "ACTIVITY_TYPE_INIT_IMPORT_WALLET", - "ACTIVITY_TYPE_IMPORT_WALLET" + "ACTIVITY_TYPE_IMPORT_WALLET", + "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" ] }, "AddressFormat": { @@ -2628,6 +2708,12 @@ "properties": { "subOrganizationId": { "type": "string" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } } }, "required": ["subOrganizationId"] @@ -2645,6 +2731,12 @@ "$ref": "#/definitions/PrivateKeyResult" }, "description": "A list of Private Key IDs and addresses." + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } } }, "required": ["subOrganizationId", "privateKeys"] @@ -2657,6 +2749,12 @@ }, "wallet": { "$ref": "#/definitions/WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } } }, "required": ["subOrganizationId"] @@ -3336,7 +3434,7 @@ }, "emailCustomization": { "$ref": "#/definitions/EmailCustomizationParams", - "description": "Optional parameters for customizing emails. If not provided, use defaults." + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." } }, "required": ["email", "targetPublicKey"] @@ -3569,7 +3667,8 @@ "FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY", "FEATURE_NAME_WEBAUTHN_ORIGINS", "FEATURE_NAME_EMAIL_AUTH", - "FEATURE_NAME_EMAIL_RECOVERY" + "FEATURE_NAME_EMAIL_RECOVERY", + "FEATURE_NAME_WEBHOOK" ] }, "GetActivitiesRequest": { @@ -3828,6 +3927,37 @@ }, "required": ["privateKeys"] }, + "GetSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent Organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL' or 'PUBLIC_KEY'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or name string." + } + }, + "required": ["organizationId"] + }, + "GetSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, "GetUserRequest": { "type": "object", "properties": { @@ -3993,6 +4123,80 @@ "HASH_FUNCTION_NOT_APPLICABLE" ] }, + "ImportPrivateKeyIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Private Key." + }, + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "encryptedBundle": { + "type": "string", + "description": "Bundle containing a raw private key encrypted to the enclave's target public key." + }, + "curve": { + "$ref": "#/definitions/Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "addressFormats": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressFormat" + }, + "description": "Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + } + }, + "required": [ + "userId", + "privateKeyName", + "encryptedBundle", + "curve", + "addressFormats" + ] + }, + "ImportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_IMPORT_PRIVATE_KEY"] + }, + "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/ImportPrivateKeyIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "ImportPrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a Private Key." + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/activity.v1.Address" + }, + "description": "A list of addresses." + } + }, + "required": ["privateKeyId", "addresses"] + }, "ImportWalletIntent": { "type": "object", "properties": { @@ -4057,6 +4261,47 @@ }, "required": ["walletId", "addresses"] }, + "InitImportPrivateKeyIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Private Key." + } + }, + "required": ["userId"] + }, + "InitImportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY"] + }, + "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/InitImportPrivateKeyIntent" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "InitImportPrivateKeyResult": { + "type": "object", + "properties": { + "importBundle": { + "type": "string", + "description": "Import bundle containing a public key and signature to use for importing client data." + } + }, + "required": ["importBundle"] + }, "InitImportWalletIntent": { "type": "object", "properties": { @@ -4112,6 +4357,10 @@ "expirationSeconds": { "type": "string", "description": "Expiration window (in seconds) indicating how long the recovery credential is valid. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." } }, "required": ["email", "targetPublicKey"] @@ -4326,6 +4575,12 @@ }, "importWalletIntent": { "$ref": "#/definitions/ImportWalletIntent" + }, + "initImportPrivateKeyIntent": { + "$ref": "#/definitions/InitImportPrivateKeyIntent" + }, + "importPrivateKeyIntent": { + "$ref": "#/definitions/ImportPrivateKeyIntent" } }, "required": ["createOrganizationIntent"] @@ -4556,6 +4811,10 @@ "exported": { "type": "boolean", "description": "True when a given Private Key is exported, false otherwise." + }, + "imported": { + "type": "boolean", + "description": "True when a given Private Key is imported, false otherwise." } }, "required": [ @@ -4567,7 +4826,8 @@ "privateKeyTags", "createdAt", "updatedAt", - "exported" + "exported", + "imported" ] }, "PrivateKeyParams": { @@ -4912,6 +5172,12 @@ }, "importWalletResult": { "$ref": "#/definitions/ImportWalletResult" + }, + "initImportPrivateKeyResult": { + "$ref": "#/definitions/InitImportPrivateKeyResult" + }, + "importPrivateKeyResult": { + "$ref": "#/definitions/ImportPrivateKeyResult" } } }, diff --git a/pkg/api/client/organizations/get_sub_org_ids_parameters.go b/pkg/api/client/organizations/get_sub_org_ids_parameters.go new file mode 100644 index 0000000..e940453 --- /dev/null +++ b/pkg/api/client/organizations/get_sub_org_ids_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" +) + +// NewGetSubOrgIdsParams creates a new GetSubOrgIdsParams 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 NewGetSubOrgIdsParams() *GetSubOrgIdsParams { + return &GetSubOrgIdsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetSubOrgIdsParamsWithTimeout creates a new GetSubOrgIdsParams object +// with the ability to set a timeout on a request. +func NewGetSubOrgIdsParamsWithTimeout(timeout time.Duration) *GetSubOrgIdsParams { + return &GetSubOrgIdsParams{ + timeout: timeout, + } +} + +// NewGetSubOrgIdsParamsWithContext creates a new GetSubOrgIdsParams object +// with the ability to set a context for a request. +func NewGetSubOrgIdsParamsWithContext(ctx context.Context) *GetSubOrgIdsParams { + return &GetSubOrgIdsParams{ + Context: ctx, + } +} + +// NewGetSubOrgIdsParamsWithHTTPClient creates a new GetSubOrgIdsParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetSubOrgIdsParamsWithHTTPClient(client *http.Client) *GetSubOrgIdsParams { + return &GetSubOrgIdsParams{ + HTTPClient: client, + } +} + +/* +GetSubOrgIdsParams contains all the parameters to send to the API endpoint + + for the get sub org ids operation. + + Typically these are written to a http.Request. +*/ +type GetSubOrgIdsParams struct { + + // Body. + Body *models.GetSubOrgIdsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get sub org ids params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubOrgIdsParams) WithDefaults() *GetSubOrgIdsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get sub org ids params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetSubOrgIdsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get sub org ids params +func (o *GetSubOrgIdsParams) WithTimeout(timeout time.Duration) *GetSubOrgIdsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get sub org ids params +func (o *GetSubOrgIdsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get sub org ids params +func (o *GetSubOrgIdsParams) WithContext(ctx context.Context) *GetSubOrgIdsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get sub org ids params +func (o *GetSubOrgIdsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get sub org ids params +func (o *GetSubOrgIdsParams) WithHTTPClient(client *http.Client) *GetSubOrgIdsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get sub org ids params +func (o *GetSubOrgIdsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get sub org ids params +func (o *GetSubOrgIdsParams) WithBody(body *models.GetSubOrgIdsRequest) *GetSubOrgIdsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get sub org ids params +func (o *GetSubOrgIdsParams) SetBody(body *models.GetSubOrgIdsRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetSubOrgIdsParams) 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/get_sub_org_ids_responses.go b/pkg/api/client/organizations/get_sub_org_ids_responses.go new file mode 100644 index 0000000..8398613 --- /dev/null +++ b/pkg/api/client/organizations/get_sub_org_ids_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" +) + +// GetSubOrgIdsReader is a Reader for the GetSubOrgIds structure. +type GetSubOrgIdsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetSubOrgIdsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetSubOrgIdsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[POST /public/v1/query/list_suborgs] GetSubOrgIds", response, response.Code()) + } +} + +// NewGetSubOrgIdsOK creates a GetSubOrgIdsOK with default headers values +func NewGetSubOrgIdsOK() *GetSubOrgIdsOK { + return &GetSubOrgIdsOK{} +} + +/* +GetSubOrgIdsOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type GetSubOrgIdsOK struct { + Payload *models.GetSubOrgIdsResponse +} + +// IsSuccess returns true when this get sub org ids o k response has a 2xx status code +func (o *GetSubOrgIdsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get sub org ids o k response has a 3xx status code +func (o *GetSubOrgIdsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get sub org ids o k response has a 4xx status code +func (o *GetSubOrgIdsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get sub org ids o k response has a 5xx status code +func (o *GetSubOrgIdsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get sub org ids o k response a status code equal to that given +func (o *GetSubOrgIdsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get sub org ids o k response +func (o *GetSubOrgIdsOK) Code() int { + return 200 +} + +func (o *GetSubOrgIdsOK) Error() string { + return fmt.Sprintf("[POST /public/v1/query/list_suborgs][%d] getSubOrgIdsOK %+v", 200, o.Payload) +} + +func (o *GetSubOrgIdsOK) String() string { + return fmt.Sprintf("[POST /public/v1/query/list_suborgs][%d] getSubOrgIdsOK %+v", 200, o.Payload) +} + +func (o *GetSubOrgIdsOK) GetPayload() *models.GetSubOrgIdsResponse { + return o.Payload +} + +func (o *GetSubOrgIdsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetSubOrgIdsResponse) + + // 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 3641c5e..8a4104b 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) + GetSubOrgIds(params *GetSubOrgIdsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubOrgIdsOK, error) + UpdateRootQuorum(params *UpdateRootQuorumParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRootQuorumOK, error) SetTransport(transport runtime.ClientTransport) @@ -78,6 +80,47 @@ func (a *Client) CreateSubOrganization(params *CreateSubOrganizationParams, auth panic(msg) } +/* +GetSubOrgIds gets suborgs + +Get all suborg IDs associated given a parent org ID and an optional filter. +*/ +func (a *Client) GetSubOrgIds(params *GetSubOrgIdsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetSubOrgIdsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetSubOrgIdsParams() + } + op := &runtime.ClientOperation{ + ID: "GetSubOrgIds", + Method: "POST", + PathPattern: "/public/v1/query/list_suborgs", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &GetSubOrgIdsReader{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.(*GetSubOrgIdsOK) + 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 GetSubOrgIds: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* UpdateRootQuorum updates root quorum diff --git a/pkg/api/client/private_keys/import_private_key_parameters.go b/pkg/api/client/private_keys/import_private_key_parameters.go new file mode 100644 index 0000000..13506cd --- /dev/null +++ b/pkg/api/client/private_keys/import_private_key_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" +) + +// NewImportPrivateKeyParams creates a new ImportPrivateKeyParams 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 NewImportPrivateKeyParams() *ImportPrivateKeyParams { + return &ImportPrivateKeyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewImportPrivateKeyParamsWithTimeout creates a new ImportPrivateKeyParams object +// with the ability to set a timeout on a request. +func NewImportPrivateKeyParamsWithTimeout(timeout time.Duration) *ImportPrivateKeyParams { + return &ImportPrivateKeyParams{ + timeout: timeout, + } +} + +// NewImportPrivateKeyParamsWithContext creates a new ImportPrivateKeyParams object +// with the ability to set a context for a request. +func NewImportPrivateKeyParamsWithContext(ctx context.Context) *ImportPrivateKeyParams { + return &ImportPrivateKeyParams{ + Context: ctx, + } +} + +// NewImportPrivateKeyParamsWithHTTPClient creates a new ImportPrivateKeyParams object +// with the ability to set a custom HTTPClient for a request. +func NewImportPrivateKeyParamsWithHTTPClient(client *http.Client) *ImportPrivateKeyParams { + return &ImportPrivateKeyParams{ + HTTPClient: client, + } +} + +/* +ImportPrivateKeyParams contains all the parameters to send to the API endpoint + + for the import private key operation. + + Typically these are written to a http.Request. +*/ +type ImportPrivateKeyParams struct { + + // Body. + Body *models.ImportPrivateKeyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the import private key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ImportPrivateKeyParams) WithDefaults() *ImportPrivateKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the import private key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ImportPrivateKeyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the import private key params +func (o *ImportPrivateKeyParams) WithTimeout(timeout time.Duration) *ImportPrivateKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the import private key params +func (o *ImportPrivateKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the import private key params +func (o *ImportPrivateKeyParams) WithContext(ctx context.Context) *ImportPrivateKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the import private key params +func (o *ImportPrivateKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the import private key params +func (o *ImportPrivateKeyParams) WithHTTPClient(client *http.Client) *ImportPrivateKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the import private key params +func (o *ImportPrivateKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the import private key params +func (o *ImportPrivateKeyParams) WithBody(body *models.ImportPrivateKeyRequest) *ImportPrivateKeyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the import private key params +func (o *ImportPrivateKeyParams) SetBody(body *models.ImportPrivateKeyRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ImportPrivateKeyParams) 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/import_private_key_responses.go b/pkg/api/client/private_keys/import_private_key_responses.go new file mode 100644 index 0000000..4d545b6 --- /dev/null +++ b/pkg/api/client/private_keys/import_private_key_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" +) + +// ImportPrivateKeyReader is a Reader for the ImportPrivateKey structure. +type ImportPrivateKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ImportPrivateKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewImportPrivateKeyOK() + 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/import_private_key] ImportPrivateKey", response, response.Code()) + } +} + +// NewImportPrivateKeyOK creates a ImportPrivateKeyOK with default headers values +func NewImportPrivateKeyOK() *ImportPrivateKeyOK { + return &ImportPrivateKeyOK{} +} + +/* +ImportPrivateKeyOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ImportPrivateKeyOK struct { + Payload *models.ActivityResponse +} + +// IsSuccess returns true when this import private key o k response has a 2xx status code +func (o *ImportPrivateKeyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this import private key o k response has a 3xx status code +func (o *ImportPrivateKeyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this import private key o k response has a 4xx status code +func (o *ImportPrivateKeyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this import private key o k response has a 5xx status code +func (o *ImportPrivateKeyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this import private key o k response a status code equal to that given +func (o *ImportPrivateKeyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the import private key o k response +func (o *ImportPrivateKeyOK) Code() int { + return 200 +} + +func (o *ImportPrivateKeyOK) Error() string { + return fmt.Sprintf("[POST /public/v1/submit/import_private_key][%d] importPrivateKeyOK %+v", 200, o.Payload) +} + +func (o *ImportPrivateKeyOK) String() string { + return fmt.Sprintf("[POST /public/v1/submit/import_private_key][%d] importPrivateKeyOK %+v", 200, o.Payload) +} + +func (o *ImportPrivateKeyOK) GetPayload() *models.ActivityResponse { + return o.Payload +} + +func (o *ImportPrivateKeyOK) 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/init_import_private_key_parameters.go b/pkg/api/client/private_keys/init_import_private_key_parameters.go new file mode 100644 index 0000000..6407e24 --- /dev/null +++ b/pkg/api/client/private_keys/init_import_private_key_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" +) + +// NewInitImportPrivateKeyParams creates a new InitImportPrivateKeyParams 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 NewInitImportPrivateKeyParams() *InitImportPrivateKeyParams { + return &InitImportPrivateKeyParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewInitImportPrivateKeyParamsWithTimeout creates a new InitImportPrivateKeyParams object +// with the ability to set a timeout on a request. +func NewInitImportPrivateKeyParamsWithTimeout(timeout time.Duration) *InitImportPrivateKeyParams { + return &InitImportPrivateKeyParams{ + timeout: timeout, + } +} + +// NewInitImportPrivateKeyParamsWithContext creates a new InitImportPrivateKeyParams object +// with the ability to set a context for a request. +func NewInitImportPrivateKeyParamsWithContext(ctx context.Context) *InitImportPrivateKeyParams { + return &InitImportPrivateKeyParams{ + Context: ctx, + } +} + +// NewInitImportPrivateKeyParamsWithHTTPClient creates a new InitImportPrivateKeyParams object +// with the ability to set a custom HTTPClient for a request. +func NewInitImportPrivateKeyParamsWithHTTPClient(client *http.Client) *InitImportPrivateKeyParams { + return &InitImportPrivateKeyParams{ + HTTPClient: client, + } +} + +/* +InitImportPrivateKeyParams contains all the parameters to send to the API endpoint + + for the init import private key operation. + + Typically these are written to a http.Request. +*/ +type InitImportPrivateKeyParams struct { + + // Body. + Body *models.InitImportPrivateKeyRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the init import private key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InitImportPrivateKeyParams) WithDefaults() *InitImportPrivateKeyParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the init import private key params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *InitImportPrivateKeyParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the init import private key params +func (o *InitImportPrivateKeyParams) WithTimeout(timeout time.Duration) *InitImportPrivateKeyParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the init import private key params +func (o *InitImportPrivateKeyParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the init import private key params +func (o *InitImportPrivateKeyParams) WithContext(ctx context.Context) *InitImportPrivateKeyParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the init import private key params +func (o *InitImportPrivateKeyParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the init import private key params +func (o *InitImportPrivateKeyParams) WithHTTPClient(client *http.Client) *InitImportPrivateKeyParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the init import private key params +func (o *InitImportPrivateKeyParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the init import private key params +func (o *InitImportPrivateKeyParams) WithBody(body *models.InitImportPrivateKeyRequest) *InitImportPrivateKeyParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the init import private key params +func (o *InitImportPrivateKeyParams) SetBody(body *models.InitImportPrivateKeyRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *InitImportPrivateKeyParams) 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/init_import_private_key_responses.go b/pkg/api/client/private_keys/init_import_private_key_responses.go new file mode 100644 index 0000000..00c46ab --- /dev/null +++ b/pkg/api/client/private_keys/init_import_private_key_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" +) + +// InitImportPrivateKeyReader is a Reader for the InitImportPrivateKey structure. +type InitImportPrivateKeyReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *InitImportPrivateKeyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewInitImportPrivateKeyOK() + 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/init_import_private_key] InitImportPrivateKey", response, response.Code()) + } +} + +// NewInitImportPrivateKeyOK creates a InitImportPrivateKeyOK with default headers values +func NewInitImportPrivateKeyOK() *InitImportPrivateKeyOK { + return &InitImportPrivateKeyOK{} +} + +/* +InitImportPrivateKeyOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type InitImportPrivateKeyOK struct { + Payload *models.ActivityResponse +} + +// IsSuccess returns true when this init import private key o k response has a 2xx status code +func (o *InitImportPrivateKeyOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this init import private key o k response has a 3xx status code +func (o *InitImportPrivateKeyOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this init import private key o k response has a 4xx status code +func (o *InitImportPrivateKeyOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this init import private key o k response has a 5xx status code +func (o *InitImportPrivateKeyOK) IsServerError() bool { + return false +} + +// IsCode returns true when this init import private key o k response a status code equal to that given +func (o *InitImportPrivateKeyOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the init import private key o k response +func (o *InitImportPrivateKeyOK) Code() int { + return 200 +} + +func (o *InitImportPrivateKeyOK) Error() string { + return fmt.Sprintf("[POST /public/v1/submit/init_import_private_key][%d] initImportPrivateKeyOK %+v", 200, o.Payload) +} + +func (o *InitImportPrivateKeyOK) String() string { + return fmt.Sprintf("[POST /public/v1/submit/init_import_private_key][%d] initImportPrivateKeyOK %+v", 200, o.Payload) +} + +func (o *InitImportPrivateKeyOK) GetPayload() *models.ActivityResponse { + return o.Payload +} + +func (o *InitImportPrivateKeyOK) 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 7f62480..b19d0b1 100644 --- a/pkg/api/client/private_keys/private_keys_client.go +++ b/pkg/api/client/private_keys/private_keys_client.go @@ -38,6 +38,10 @@ type ClientService interface { GetPrivateKeys(params *GetPrivateKeysParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetPrivateKeysOK, error) + ImportPrivateKey(params *ImportPrivateKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportPrivateKeyOK, error) + + InitImportPrivateKey(params *InitImportPrivateKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InitImportPrivateKeyOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -205,6 +209,88 @@ func (a *Client) GetPrivateKeys(params *GetPrivateKeysParams, authInfo runtime.C panic(msg) } +/* +ImportPrivateKey imports private key + +Imports a private key +*/ +func (a *Client) ImportPrivateKey(params *ImportPrivateKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ImportPrivateKeyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewImportPrivateKeyParams() + } + op := &runtime.ClientOperation{ + ID: "ImportPrivateKey", + Method: "POST", + PathPattern: "/public/v1/submit/import_private_key", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ImportPrivateKeyReader{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.(*ImportPrivateKeyOK) + 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 ImportPrivateKey: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +InitImportPrivateKey inits import private key + +Initializes a new private key import +*/ +func (a *Client) InitImportPrivateKey(params *InitImportPrivateKeyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InitImportPrivateKeyOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewInitImportPrivateKeyParams() + } + op := &runtime.ClientOperation{ + ID: "InitImportPrivateKey", + Method: "POST", + PathPattern: "/public/v1/submit/init_import_private_key", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &InitImportPrivateKeyReader{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.(*InitImportPrivateKeyOK) + 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 InitImportPrivateKey: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/pkg/api/models/activity_type.go b/pkg/api/models/activity_type.go index 481300e..b0cb0be 100644 --- a/pkg/api/models/activity_type.go +++ b/pkg/api/models/activity_type.go @@ -206,6 +206,12 @@ const ( // ActivityTypeImportWallet captures enum value "ACTIVITY_TYPE_IMPORT_WALLET" ActivityTypeImportWallet ActivityType = "ACTIVITY_TYPE_IMPORT_WALLET" + + // ActivityTypeInitImportPrivateKey captures enum value "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" + ActivityTypeInitImportPrivateKey ActivityType = "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" + + // ActivityTypeImportPrivateKey captures enum value "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" + ActivityTypeImportPrivateKey ActivityType = "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" ) // for schema @@ -213,7 +219,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"]`), &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"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/api/models/create_sub_organization_result.go b/pkg/api/models/create_sub_organization_result.go index 16e1db5..d5a3df9 100644 --- a/pkg/api/models/create_sub_organization_result.go +++ b/pkg/api/models/create_sub_organization_result.go @@ -19,6 +19,9 @@ import ( // swagger:model CreateSubOrganizationResult type CreateSubOrganizationResult struct { + // root user ids + RootUserIds []string `json:"rootUserIds"` + // sub organization Id // Required: true SubOrganizationID *string `json:"subOrganizationId"` diff --git a/pkg/api/models/create_sub_organization_result_v3.go b/pkg/api/models/create_sub_organization_result_v3.go index 26fd5d3..2484b48 100644 --- a/pkg/api/models/create_sub_organization_result_v3.go +++ b/pkg/api/models/create_sub_organization_result_v3.go @@ -24,6 +24,9 @@ type CreateSubOrganizationResultV3 struct { // Required: true PrivateKeys []*PrivateKeyResult `json:"privateKeys"` + // root user ids + RootUserIds []string `json:"rootUserIds"` + // sub organization Id // Required: true SubOrganizationID *string `json:"subOrganizationId"` diff --git a/pkg/api/models/create_sub_organization_result_v4.go b/pkg/api/models/create_sub_organization_result_v4.go index dcfd0ff..cc146e4 100644 --- a/pkg/api/models/create_sub_organization_result_v4.go +++ b/pkg/api/models/create_sub_organization_result_v4.go @@ -19,6 +19,9 @@ import ( // swagger:model CreateSubOrganizationResultV4 type CreateSubOrganizationResultV4 struct { + // root user ids + RootUserIds []string `json:"rootUserIds"` + // sub organization Id // Required: true SubOrganizationID *string `json:"subOrganizationId"` diff --git a/pkg/api/models/email_auth_intent.go b/pkg/api/models/email_auth_intent.go index c973c14..cd4d4c0 100644 --- a/pkg/api/models/email_auth_intent.go +++ b/pkg/api/models/email_auth_intent.go @@ -26,7 +26,7 @@ type EmailAuthIntent struct { // Required: true Email *string `json:"email"` - // Optional parameters for customizing emails. If not provided, use defaults. + // Optional parameters for customizing emails. If not provided, the default email will be used. EmailCustomization *EmailCustomizationParams `json:"emailCustomization,omitempty"` // Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used. diff --git a/pkg/api/models/feature_name.go b/pkg/api/models/feature_name.go index d146bf6..0104a5a 100644 --- a/pkg/api/models/feature_name.go +++ b/pkg/api/models/feature_name.go @@ -41,6 +41,9 @@ const ( // FeatureNameEmailRecovery captures enum value "FEATURE_NAME_EMAIL_RECOVERY" FeatureNameEmailRecovery FeatureName = "FEATURE_NAME_EMAIL_RECOVERY" + + // FeatureNameWebhook captures enum value "FEATURE_NAME_WEBHOOK" + FeatureNameWebhook FeatureName = "FEATURE_NAME_WEBHOOK" ) // for schema @@ -48,7 +51,7 @@ var FeatureNameEnum []FeatureName func init() { var res []FeatureName - if err := json.Unmarshal([]byte(`["FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY","FEATURE_NAME_WEBAUTHN_ORIGINS","FEATURE_NAME_EMAIL_AUTH","FEATURE_NAME_EMAIL_RECOVERY"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY","FEATURE_NAME_WEBAUTHN_ORIGINS","FEATURE_NAME_EMAIL_AUTH","FEATURE_NAME_EMAIL_RECOVERY","FEATURE_NAME_WEBHOOK"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/api/models/get_sub_org_ids_request.go b/pkg/api/models/get_sub_org_ids_request.go new file mode 100644 index 0000000..e9215eb --- /dev/null +++ b/pkg/api/models/get_sub_org_ids_request.go @@ -0,0 +1,77 @@ +// 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" +) + +// GetSubOrgIdsRequest get sub org ids request +// +// swagger:model GetSubOrgIdsRequest +type GetSubOrgIdsRequest struct { + + // Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL' or 'PUBLIC_KEY' + FilterType string `json:"filterType,omitempty"` + + // The value of the filter to apply for the specified type. For example, a specific email or name string. + FilterValue string `json:"filterValue,omitempty"` + + // Unique identifier for the parent Organization. This is used to find sub-organizations within it. + // Required: true + OrganizationID *string `json:"organizationId"` +} + +// Validate validates this get sub org ids request +func (m *GetSubOrgIdsRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOrganizationID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetSubOrgIdsRequest) validateOrganizationID(formats strfmt.Registry) error { + + if err := validate.Required("organizationId", "body", m.OrganizationID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get sub org ids request based on context it is used +func (m *GetSubOrgIdsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetSubOrgIdsRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetSubOrgIdsRequest) UnmarshalBinary(b []byte) error { + var res GetSubOrgIdsRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/get_sub_org_ids_response.go b/pkg/api/models/get_sub_org_ids_response.go new file mode 100644 index 0000000..fccc033 --- /dev/null +++ b/pkg/api/models/get_sub_org_ids_response.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" +) + +// GetSubOrgIdsResponse get sub org ids response +// +// swagger:model GetSubOrgIdsResponse +type GetSubOrgIdsResponse struct { + + // List of unique identifiers for the matching sub-organizations. + // Required: true + OrganizationIds []string `json:"organizationIds"` +} + +// Validate validates this get sub org ids response +func (m *GetSubOrgIdsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateOrganizationIds(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GetSubOrgIdsResponse) validateOrganizationIds(formats strfmt.Registry) error { + + if err := validate.Required("organizationIds", "body", m.OrganizationIds); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this get sub org ids response based on context it is used +func (m *GetSubOrgIdsResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *GetSubOrgIdsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GetSubOrgIdsResponse) UnmarshalBinary(b []byte) error { + var res GetSubOrgIdsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/import_private_key_intent.go b/pkg/api/models/import_private_key_intent.go new file mode 100644 index 0000000..5ad96dc --- /dev/null +++ b/pkg/api/models/import_private_key_intent.go @@ -0,0 +1,220 @@ +// 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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ImportPrivateKeyIntent import private key intent +// +// swagger:model ImportPrivateKeyIntent +type ImportPrivateKeyIntent struct { + + // Cryptocurrency-specific formats for a derived address (e.g., Ethereum). + // Required: true + AddressFormats []AddressFormat `json:"addressFormats"` + + // Cryptographic Curve used to generate a given Private Key. + // Required: true + Curve *Curve `json:"curve"` + + // Bundle containing a raw private key encrypted to the enclave's target public key. + // Required: true + EncryptedBundle *string `json:"encryptedBundle"` + + // Human-readable name for a Private Key. + // Required: true + PrivateKeyName *string `json:"privateKeyName"` + + // The ID of the User importing a Private Key. + // Required: true + UserID *string `json:"userId"` +} + +// Validate validates this import private key intent +func (m *ImportPrivateKeyIntent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddressFormats(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurve(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEncryptedBundle(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivateKeyName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImportPrivateKeyIntent) validateAddressFormats(formats strfmt.Registry) error { + + if err := validate.Required("addressFormats", "body", m.AddressFormats); err != nil { + return err + } + + for i := 0; i < len(m.AddressFormats); i++ { + + if err := m.AddressFormats[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addressFormats" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addressFormats" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ImportPrivateKeyIntent) validateCurve(formats strfmt.Registry) error { + + if err := validate.Required("curve", "body", m.Curve); err != nil { + return err + } + + if err := validate.Required("curve", "body", m.Curve); err != nil { + return err + } + + if m.Curve != nil { + if err := m.Curve.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("curve") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("curve") + } + return err + } + } + + return nil +} + +func (m *ImportPrivateKeyIntent) validateEncryptedBundle(formats strfmt.Registry) error { + + if err := validate.Required("encryptedBundle", "body", m.EncryptedBundle); err != nil { + return err + } + + return nil +} + +func (m *ImportPrivateKeyIntent) validatePrivateKeyName(formats strfmt.Registry) error { + + if err := validate.Required("privateKeyName", "body", m.PrivateKeyName); err != nil { + return err + } + + return nil +} + +func (m *ImportPrivateKeyIntent) validateUserID(formats strfmt.Registry) error { + + if err := validate.Required("userId", "body", m.UserID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this import private key intent based on the context it is used +func (m *ImportPrivateKeyIntent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddressFormats(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCurve(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImportPrivateKeyIntent) contextValidateAddressFormats(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.AddressFormats); i++ { + + if swag.IsZero(m.AddressFormats[i]) { // not required + return nil + } + + if err := m.AddressFormats[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addressFormats" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addressFormats" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *ImportPrivateKeyIntent) contextValidateCurve(ctx context.Context, formats strfmt.Registry) error { + + if m.Curve != nil { + + if err := m.Curve.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("curve") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("curve") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImportPrivateKeyIntent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImportPrivateKeyIntent) UnmarshalBinary(b []byte) error { + var res ImportPrivateKeyIntent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/import_private_key_request.go b/pkg/api/models/import_private_key_request.go new file mode 100644 index 0000000..f877cab --- /dev/null +++ b/pkg/api/models/import_private_key_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" +) + +// ImportPrivateKeyRequest import private key request +// +// swagger:model ImportPrivateKeyRequest +type ImportPrivateKeyRequest struct { + + // Unique identifier for a given Organization. + // Required: true + OrganizationID *string `json:"organizationId"` + + // parameters + // Required: true + Parameters *ImportPrivateKeyIntent `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_IMPORT_PRIVATE_KEY] + Type *string `json:"type"` +} + +// Validate validates this import private key request +func (m *ImportPrivateKeyRequest) 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 *ImportPrivateKeyRequest) validateOrganizationID(formats strfmt.Registry) error { + + if err := validate.Required("organizationId", "body", m.OrganizationID); err != nil { + return err + } + + return nil +} + +func (m *ImportPrivateKeyRequest) 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 *ImportPrivateKeyRequest) validateTimestampMs(formats strfmt.Registry) error { + + if err := validate.Required("timestampMs", "body", m.TimestampMs); err != nil { + return err + } + + return nil +} + +var importPrivateKeyRequestTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_IMPORT_PRIVATE_KEY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + importPrivateKeyRequestTypeTypePropEnum = append(importPrivateKeyRequestTypeTypePropEnum, v) + } +} + +const ( + + // ImportPrivateKeyRequestTypeACTIVITYTYPEIMPORTPRIVATEKEY captures enum value "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" + ImportPrivateKeyRequestTypeACTIVITYTYPEIMPORTPRIVATEKEY string = "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" +) + +// prop value enum +func (m *ImportPrivateKeyRequest) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, importPrivateKeyRequestTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ImportPrivateKeyRequest) 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 import private key request based on the context it is used +func (m *ImportPrivateKeyRequest) 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 *ImportPrivateKeyRequest) 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 *ImportPrivateKeyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImportPrivateKeyRequest) UnmarshalBinary(b []byte) error { + var res ImportPrivateKeyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/import_private_key_result.go b/pkg/api/models/import_private_key_result.go new file mode 100644 index 0000000..4837f1d --- /dev/null +++ b/pkg/api/models/import_private_key_result.go @@ -0,0 +1,141 @@ +// 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" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ImportPrivateKeyResult import private key result +// +// swagger:model ImportPrivateKeyResult +type ImportPrivateKeyResult struct { + + // A list of addresses. + // Required: true + Addresses []*ActivityV1Address `json:"addresses"` + + // Unique identifier for a Private Key. + // Required: true + PrivateKeyID *string `json:"privateKeyId"` +} + +// Validate validates this import private key result +func (m *ImportPrivateKeyResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddresses(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivateKeyID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImportPrivateKeyResult) validateAddresses(formats strfmt.Registry) error { + + if err := validate.Required("addresses", "body", m.Addresses); err != nil { + return err + } + + for i := 0; i < len(m.Addresses); i++ { + if swag.IsZero(m.Addresses[i]) { // not required + continue + } + + if m.Addresses[i] != nil { + if err := m.Addresses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ImportPrivateKeyResult) validatePrivateKeyID(formats strfmt.Registry) error { + + if err := validate.Required("privateKeyId", "body", m.PrivateKeyID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this import private key result based on the context it is used +func (m *ImportPrivateKeyResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddresses(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImportPrivateKeyResult) contextValidateAddresses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Addresses); i++ { + + if m.Addresses[i] != nil { + + if swag.IsZero(m.Addresses[i]) { // not required + return nil + } + + if err := m.Addresses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addresses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addresses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImportPrivateKeyResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImportPrivateKeyResult) UnmarshalBinary(b []byte) error { + var res ImportPrivateKeyResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_import_private_key_intent.go b/pkg/api/models/init_import_private_key_intent.go new file mode 100644 index 0000000..a25047e --- /dev/null +++ b/pkg/api/models/init_import_private_key_intent.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" +) + +// InitImportPrivateKeyIntent init import private key intent +// +// swagger:model InitImportPrivateKeyIntent +type InitImportPrivateKeyIntent struct { + + // The ID of the User importing a Private Key. + // Required: true + UserID *string `json:"userId"` +} + +// Validate validates this init import private key intent +func (m *InitImportPrivateKeyIntent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitImportPrivateKeyIntent) validateUserID(formats strfmt.Registry) error { + + if err := validate.Required("userId", "body", m.UserID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this init import private key intent based on context it is used +func (m *InitImportPrivateKeyIntent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InitImportPrivateKeyIntent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InitImportPrivateKeyIntent) UnmarshalBinary(b []byte) error { + var res InitImportPrivateKeyIntent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_import_private_key_request.go b/pkg/api/models/init_import_private_key_request.go new file mode 100644 index 0000000..d6eaede --- /dev/null +++ b/pkg/api/models/init_import_private_key_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" +) + +// InitImportPrivateKeyRequest init import private key request +// +// swagger:model InitImportPrivateKeyRequest +type InitImportPrivateKeyRequest struct { + + // Unique identifier for a given Organization. + // Required: true + OrganizationID *string `json:"organizationId"` + + // parameters + // Required: true + Parameters *InitImportPrivateKeyIntent `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_INIT_IMPORT_PRIVATE_KEY] + Type *string `json:"type"` +} + +// Validate validates this init import private key request +func (m *InitImportPrivateKeyRequest) 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 *InitImportPrivateKeyRequest) validateOrganizationID(formats strfmt.Registry) error { + + if err := validate.Required("organizationId", "body", m.OrganizationID); err != nil { + return err + } + + return nil +} + +func (m *InitImportPrivateKeyRequest) 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 *InitImportPrivateKeyRequest) validateTimestampMs(formats strfmt.Registry) error { + + if err := validate.Required("timestampMs", "body", m.TimestampMs); err != nil { + return err + } + + return nil +} + +var initImportPrivateKeyRequestTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + initImportPrivateKeyRequestTypeTypePropEnum = append(initImportPrivateKeyRequestTypeTypePropEnum, v) + } +} + +const ( + + // InitImportPrivateKeyRequestTypeACTIVITYTYPEINITIMPORTPRIVATEKEY captures enum value "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" + InitImportPrivateKeyRequestTypeACTIVITYTYPEINITIMPORTPRIVATEKEY string = "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" +) + +// prop value enum +func (m *InitImportPrivateKeyRequest) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, initImportPrivateKeyRequestTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *InitImportPrivateKeyRequest) 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 init import private key request based on the context it is used +func (m *InitImportPrivateKeyRequest) 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 *InitImportPrivateKeyRequest) 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 *InitImportPrivateKeyRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InitImportPrivateKeyRequest) UnmarshalBinary(b []byte) error { + var res InitImportPrivateKeyRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_import_private_key_result.go b/pkg/api/models/init_import_private_key_result.go new file mode 100644 index 0000000..44c3e54 --- /dev/null +++ b/pkg/api/models/init_import_private_key_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" +) + +// InitImportPrivateKeyResult init import private key result +// +// swagger:model InitImportPrivateKeyResult +type InitImportPrivateKeyResult struct { + + // Import bundle containing a public key and signature to use for importing client data. + // Required: true + ImportBundle *string `json:"importBundle"` +} + +// Validate validates this init import private key result +func (m *InitImportPrivateKeyResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImportBundle(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitImportPrivateKeyResult) validateImportBundle(formats strfmt.Registry) error { + + if err := validate.Required("importBundle", "body", m.ImportBundle); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this init import private key result based on context it is used +func (m *InitImportPrivateKeyResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InitImportPrivateKeyResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InitImportPrivateKeyResult) UnmarshalBinary(b []byte) error { + var res InitImportPrivateKeyResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/api/models/init_user_email_recovery_intent.go b/pkg/api/models/init_user_email_recovery_intent.go index b5b67fd..f0500ba 100644 --- a/pkg/api/models/init_user_email_recovery_intent.go +++ b/pkg/api/models/init_user_email_recovery_intent.go @@ -23,6 +23,9 @@ type InitUserEmailRecoveryIntent struct { // Required: true Email *string `json:"email"` + // Optional parameters for customizing emails. If not provided, the default email will be used. + EmailCustomization *EmailCustomizationParams `json:"emailCustomization,omitempty"` + // Expiration window (in seconds) indicating how long the recovery credential is valid. If not provided, a default of 15 minutes will be used. ExpirationSeconds string `json:"expirationSeconds,omitempty"` @@ -39,6 +42,10 @@ func (m *InitUserEmailRecoveryIntent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateEmailCustomization(formats); err != nil { + res = append(res, err) + } + if err := m.validateTargetPublicKey(formats); err != nil { res = append(res, err) } @@ -58,6 +65,25 @@ func (m *InitUserEmailRecoveryIntent) validateEmail(formats strfmt.Registry) err return nil } +func (m *InitUserEmailRecoveryIntent) validateEmailCustomization(formats strfmt.Registry) error { + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if m.EmailCustomization != nil { + if err := m.EmailCustomization.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + + return nil +} + func (m *InitUserEmailRecoveryIntent) validateTargetPublicKey(formats strfmt.Registry) error { if err := validate.Required("targetPublicKey", "body", m.TargetPublicKey); err != nil { @@ -67,8 +93,38 @@ func (m *InitUserEmailRecoveryIntent) validateTargetPublicKey(formats strfmt.Reg return nil } -// ContextValidate validates this init user email recovery intent based on context it is used +// ContextValidate validate this init user email recovery intent based on the context it is used func (m *InitUserEmailRecoveryIntent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmailCustomization(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InitUserEmailRecoveryIntent) contextValidateEmailCustomization(ctx context.Context, formats strfmt.Registry) error { + + if m.EmailCustomization != nil { + + if swag.IsZero(m.EmailCustomization) { // not required + return nil + } + + if err := m.EmailCustomization.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emailCustomization") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emailCustomization") + } + return err + } + } + return nil } diff --git a/pkg/api/models/intent.go b/pkg/api/models/intent.go index 6717360..df51ae4 100644 --- a/pkg/api/models/intent.go +++ b/pkg/api/models/intent.go @@ -140,9 +140,15 @@ type Intent struct { // export wallet intent ExportWalletIntent *ExportWalletIntent `json:"exportWalletIntent,omitempty"` + // import private key intent + ImportPrivateKeyIntent *ImportPrivateKeyIntent `json:"importPrivateKeyIntent,omitempty"` + // import wallet intent ImportWalletIntent *ImportWalletIntent `json:"importWalletIntent,omitempty"` + // init import private key intent + InitImportPrivateKeyIntent *InitImportPrivateKeyIntent `json:"initImportPrivateKeyIntent,omitempty"` + // init import wallet intent InitImportWalletIntent *InitImportWalletIntent `json:"initImportWalletIntent,omitempty"` @@ -362,10 +368,18 @@ func (m *Intent) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateImportPrivateKeyIntent(formats); err != nil { + res = append(res, err) + } + if err := m.validateImportWalletIntent(formats); err != nil { res = append(res, err) } + if err := m.validateInitImportPrivateKeyIntent(formats); err != nil { + res = append(res, err) + } + if err := m.validateInitImportWalletIntent(formats); err != nil { res = append(res, err) } @@ -1205,6 +1219,25 @@ func (m *Intent) validateExportWalletIntent(formats strfmt.Registry) error { return nil } +func (m *Intent) validateImportPrivateKeyIntent(formats strfmt.Registry) error { + if swag.IsZero(m.ImportPrivateKeyIntent) { // not required + return nil + } + + if m.ImportPrivateKeyIntent != nil { + if err := m.ImportPrivateKeyIntent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("importPrivateKeyIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("importPrivateKeyIntent") + } + return err + } + } + + return nil +} + func (m *Intent) validateImportWalletIntent(formats strfmt.Registry) error { if swag.IsZero(m.ImportWalletIntent) { // not required return nil @@ -1224,6 +1257,25 @@ func (m *Intent) validateImportWalletIntent(formats strfmt.Registry) error { return nil } +func (m *Intent) validateInitImportPrivateKeyIntent(formats strfmt.Registry) error { + if swag.IsZero(m.InitImportPrivateKeyIntent) { // not required + return nil + } + + if m.InitImportPrivateKeyIntent != nil { + if err := m.InitImportPrivateKeyIntent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initImportPrivateKeyIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initImportPrivateKeyIntent") + } + return err + } + } + + return nil +} + func (m *Intent) validateInitImportWalletIntent(formats strfmt.Registry) error { if swag.IsZero(m.InitImportWalletIntent) { // not required return nil @@ -1730,10 +1782,18 @@ func (m *Intent) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateImportPrivateKeyIntent(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateImportWalletIntent(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateInitImportPrivateKeyIntent(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateInitImportWalletIntent(ctx, formats); err != nil { res = append(res, err) } @@ -2648,6 +2708,27 @@ func (m *Intent) contextValidateExportWalletIntent(ctx context.Context, formats return nil } +func (m *Intent) contextValidateImportPrivateKeyIntent(ctx context.Context, formats strfmt.Registry) error { + + if m.ImportPrivateKeyIntent != nil { + + if swag.IsZero(m.ImportPrivateKeyIntent) { // not required + return nil + } + + if err := m.ImportPrivateKeyIntent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("importPrivateKeyIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("importPrivateKeyIntent") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateImportWalletIntent(ctx context.Context, formats strfmt.Registry) error { if m.ImportWalletIntent != nil { @@ -2669,6 +2750,27 @@ func (m *Intent) contextValidateImportWalletIntent(ctx context.Context, formats return nil } +func (m *Intent) contextValidateInitImportPrivateKeyIntent(ctx context.Context, formats strfmt.Registry) error { + + if m.InitImportPrivateKeyIntent != nil { + + if swag.IsZero(m.InitImportPrivateKeyIntent) { // not required + return nil + } + + if err := m.InitImportPrivateKeyIntent.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initImportPrivateKeyIntent") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initImportPrivateKeyIntent") + } + return err + } + } + + return nil +} + func (m *Intent) contextValidateInitImportWalletIntent(ctx context.Context, formats strfmt.Registry) error { if m.InitImportWalletIntent != nil { diff --git a/pkg/api/models/private_key.go b/pkg/api/models/private_key.go index 0342459..74f13de 100644 --- a/pkg/api/models/private_key.go +++ b/pkg/api/models/private_key.go @@ -36,6 +36,10 @@ type PrivateKey struct { // Required: true Exported *bool `json:"exported"` + // True when a given Private Key is imported, false otherwise. + // Required: true + Imported *bool `json:"imported"` + // Unique identifier for a given Private Key. // Required: true PrivateKeyID *string `json:"privateKeyId"` @@ -77,6 +81,10 @@ func (m *PrivateKey) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateImported(formats); err != nil { + res = append(res, err) + } + if err := m.validatePrivateKeyID(formats); err != nil { res = append(res, err) } @@ -183,6 +191,15 @@ func (m *PrivateKey) validateExported(formats strfmt.Registry) error { return nil } +func (m *PrivateKey) validateImported(formats strfmt.Registry) error { + + if err := validate.Required("imported", "body", m.Imported); err != nil { + return err + } + + return nil +} + func (m *PrivateKey) validatePrivateKeyID(formats strfmt.Registry) error { if err := validate.Required("privateKeyId", "body", m.PrivateKeyID); err != nil { diff --git a/pkg/api/models/result.go b/pkg/api/models/result.go index 7fb304d..b339f5d 100644 --- a/pkg/api/models/result.go +++ b/pkg/api/models/result.go @@ -114,9 +114,15 @@ type Result struct { // export wallet result ExportWalletResult *ExportWalletResult `json:"exportWalletResult,omitempty"` + // import private key result + ImportPrivateKeyResult *ImportPrivateKeyResult `json:"importPrivateKeyResult,omitempty"` + // import wallet result ImportWalletResult *ImportWalletResult `json:"importWalletResult,omitempty"` + // init import private key result + InitImportPrivateKeyResult *InitImportPrivateKeyResult `json:"initImportPrivateKeyResult,omitempty"` + // init import wallet result InitImportWalletResult *InitImportWalletResult `json:"initImportWalletResult,omitempty"` @@ -292,10 +298,18 @@ func (m *Result) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateImportPrivateKeyResult(formats); err != nil { + res = append(res, err) + } + if err := m.validateImportWalletResult(formats); err != nil { res = append(res, err) } + if err := m.validateInitImportPrivateKeyResult(formats); err != nil { + res = append(res, err) + } + if err := m.validateInitImportWalletResult(formats); err != nil { res = append(res, err) } @@ -958,6 +972,25 @@ func (m *Result) validateExportWalletResult(formats strfmt.Registry) error { return nil } +func (m *Result) validateImportPrivateKeyResult(formats strfmt.Registry) error { + if swag.IsZero(m.ImportPrivateKeyResult) { // not required + return nil + } + + if m.ImportPrivateKeyResult != nil { + if err := m.ImportPrivateKeyResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("importPrivateKeyResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("importPrivateKeyResult") + } + return err + } + } + + return nil +} + func (m *Result) validateImportWalletResult(formats strfmt.Registry) error { if swag.IsZero(m.ImportWalletResult) { // not required return nil @@ -977,6 +1010,25 @@ func (m *Result) validateImportWalletResult(formats strfmt.Registry) error { return nil } +func (m *Result) validateInitImportPrivateKeyResult(formats strfmt.Registry) error { + if swag.IsZero(m.InitImportPrivateKeyResult) { // not required + return nil + } + + if m.InitImportPrivateKeyResult != nil { + if err := m.InitImportPrivateKeyResult.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initImportPrivateKeyResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initImportPrivateKeyResult") + } + return err + } + } + + return nil +} + func (m *Result) validateInitImportWalletResult(formats strfmt.Registry) error { if swag.IsZero(m.InitImportWalletResult) { // not required return nil @@ -1337,10 +1389,18 @@ func (m *Result) ContextValidate(ctx context.Context, formats strfmt.Registry) e res = append(res, err) } + if err := m.contextValidateImportPrivateKeyResult(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateImportWalletResult(ctx, formats); err != nil { res = append(res, err) } + if err := m.contextValidateInitImportPrivateKeyResult(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateInitImportWalletResult(ctx, formats); err != nil { res = append(res, err) } @@ -2067,6 +2127,27 @@ func (m *Result) contextValidateExportWalletResult(ctx context.Context, formats return nil } +func (m *Result) contextValidateImportPrivateKeyResult(ctx context.Context, formats strfmt.Registry) error { + + if m.ImportPrivateKeyResult != nil { + + if swag.IsZero(m.ImportPrivateKeyResult) { // not required + return nil + } + + if err := m.ImportPrivateKeyResult.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("importPrivateKeyResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("importPrivateKeyResult") + } + return err + } + } + + return nil +} + func (m *Result) contextValidateImportWalletResult(ctx context.Context, formats strfmt.Registry) error { if m.ImportWalletResult != nil { @@ -2088,6 +2169,27 @@ func (m *Result) contextValidateImportWalletResult(ctx context.Context, formats return nil } +func (m *Result) contextValidateInitImportPrivateKeyResult(ctx context.Context, formats strfmt.Registry) error { + + if m.InitImportPrivateKeyResult != nil { + + if swag.IsZero(m.InitImportPrivateKeyResult) { // not required + return nil + } + + if err := m.InitImportPrivateKeyResult.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("initImportPrivateKeyResult") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("initImportPrivateKeyResult") + } + return err + } + } + + return nil +} + func (m *Result) contextValidateInitImportWalletResult(ctx context.Context, formats strfmt.Registry) error { if m.InitImportWalletResult != nil {