hanko-go/client/admin/client_gen.go
2025-08-04 17:23:06 +02:00

5074 lines
150 KiB
Go

// Package adminclient provides primitives to interact with the openapi HTTP API.
//
// Code generated by unknown module path version unknown version DO NOT EDIT.
package adminclient
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"time"
"github.com/oapi-codegen/runtime"
openapi_types "github.com/oapi-codegen/runtime/types"
)
const (
BearerApiKeyAuthScopes = "BearerApiKeyAuth.Scopes"
)
// Defines values for AuditLogTypes.
const (
AuditLogTypesPasscodeLoginFinalFailed AuditLogTypes = "passcode_login_final_failed"
AuditLogTypesPasscodeLoginFinalSucceeded AuditLogTypes = "passcode_login_final_succeeded"
AuditLogTypesPasscodeLoginInitFailed AuditLogTypes = "passcode_login_init_failed"
AuditLogTypesPasscodeLoginInitSucceeded AuditLogTypes = "passcode_login_init_succeeded"
AuditLogTypesPasswordLoginFailed AuditLogTypes = "password_login_failed"
AuditLogTypesPasswordLoginSucceeded AuditLogTypes = "password_login_succeeded"
AuditLogTypesPasswordSetFailed AuditLogTypes = "password_set_failed"
AuditLogTypesPasswordSetSucceeded AuditLogTypes = "password_set_succeeded"
AuditLogTypesThirdpartySigninSucceeded AuditLogTypes = "thirdparty_signin_succeeded"
AuditLogTypesThirdpartySignupSucceeded AuditLogTypes = "thirdparty_signup_succeeded"
AuditLogTypesUserCreated AuditLogTypes = "user_created"
AuditLogTypesWebauthnAuthenticationFinalFailed AuditLogTypes = "webauthn_authentication_final_failed"
AuditLogTypesWebauthnAuthenticationFinalSucceeded AuditLogTypes = "webauthn_authentication_final_succeeded"
AuditLogTypesWebauthnAuthenticationInitFailed AuditLogTypes = "webauthn_authentication_init_failed"
AuditLogTypesWebauthnAuthenticationInitSucceeded AuditLogTypes = "webauthn_authentication_init_succeeded"
AuditLogTypesWebauthnRegistrationFinalFailed AuditLogTypes = "webauthn_registration_final_failed"
AuditLogTypesWebauthnRegistrationFinalSucceeded AuditLogTypes = "webauthn_registration_final_succeeded"
AuditLogTypesWebauthnRegistrationInitFailed AuditLogTypes = "webauthn_registration_init_failed"
AuditLogTypesWebauthnRegistrationInitSucceeded AuditLogTypes = "webauthn_registration_init_succeeded"
)
// Defines values for DatabaseWebhookEventEvent.
const (
DatabaseWebhookEventEventEmailSend DatabaseWebhookEventEvent = "email.send"
DatabaseWebhookEventEventUser DatabaseWebhookEventEvent = "user"
DatabaseWebhookEventEventUserCreate DatabaseWebhookEventEvent = "user.create"
DatabaseWebhookEventEventUserDelete DatabaseWebhookEventEvent = "user.delete"
DatabaseWebhookEventEventUserLogin DatabaseWebhookEventEvent = "user.login"
DatabaseWebhookEventEventUserUpdate DatabaseWebhookEventEvent = "user.update"
DatabaseWebhookEventEventUserUpdateEmail DatabaseWebhookEventEvent = "user.update.email"
DatabaseWebhookEventEventUserUpdateEmailCreate DatabaseWebhookEventEvent = "user.update.email.create"
DatabaseWebhookEventEventUserUpdateEmailDelete DatabaseWebhookEventEvent = "user.update.email.delete"
DatabaseWebhookEventEventUserUpdateEmailPrimary DatabaseWebhookEventEvent = "user.update.email.primary"
DatabaseWebhookEventEventUserUpdateUsername DatabaseWebhookEventEvent = "user.update.username"
DatabaseWebhookEventEventUserUpdateUsernameCreate DatabaseWebhookEventEvent = "user.update.username.create"
DatabaseWebhookEventEventUserUpdateUsernameDelete DatabaseWebhookEventEvent = "user.update.username.delete"
DatabaseWebhookEventEventUserUpdateUsernameUpdate DatabaseWebhookEventEvent = "user.update.username.update"
)
// Defines values for WebhookEvents.
const (
WebhookEventsEmailSend WebhookEvents = "email.send"
WebhookEventsUser WebhookEvents = "user"
WebhookEventsUserCreate WebhookEvents = "user.create"
WebhookEventsUserDelete WebhookEvents = "user.delete"
WebhookEventsUserLogin WebhookEvents = "user.login"
WebhookEventsUserUpdate WebhookEvents = "user.update"
WebhookEventsUserUpdateEmail WebhookEvents = "user.update.email"
WebhookEventsUserUpdateEmailCreate WebhookEvents = "user.update.email.create"
WebhookEventsUserUpdateEmailDelete WebhookEvents = "user.update.email.delete"
WebhookEventsUserUpdateEmailPrimary WebhookEvents = "user.update.email.primary"
WebhookEventsUserUpdateUsername WebhookEvents = "user.update.username"
WebhookEventsUserUpdateUsernameCreate WebhookEvents = "user.update.username.create"
WebhookEventsUserUpdateUsernameDelete WebhookEvents = "user.update.username.delete"
WebhookEventsUserUpdateUsernameUpdate WebhookEvents = "user.update.username.update"
)
// Defines values for ListUsersParamsSortDirection.
const (
ListUsersParamsSortDirectionAsc ListUsersParamsSortDirection = "asc"
ListUsersParamsSortDirectionDesc ListUsersParamsSortDirection = "desc"
)
// Defines values for PutWebhooksIdJSONBodyEvents.
const (
PutWebhooksIdJSONBodyEventsEmailSend PutWebhooksIdJSONBodyEvents = "email.send"
PutWebhooksIdJSONBodyEventsUser PutWebhooksIdJSONBodyEvents = "user"
PutWebhooksIdJSONBodyEventsUserCreate PutWebhooksIdJSONBodyEvents = "user.create"
PutWebhooksIdJSONBodyEventsUserDelete PutWebhooksIdJSONBodyEvents = "user.delete"
PutWebhooksIdJSONBodyEventsUserLogin PutWebhooksIdJSONBodyEvents = "user.login"
PutWebhooksIdJSONBodyEventsUserUpdate PutWebhooksIdJSONBodyEvents = "user.update"
PutWebhooksIdJSONBodyEventsUserUpdateEmail PutWebhooksIdJSONBodyEvents = "user.update.email"
PutWebhooksIdJSONBodyEventsUserUpdateEmailCreate PutWebhooksIdJSONBodyEvents = "user.update.email.create"
PutWebhooksIdJSONBodyEventsUserUpdateEmailDelete PutWebhooksIdJSONBodyEvents = "user.update.email.delete"
PutWebhooksIdJSONBodyEventsUserUpdateEmailPrimary PutWebhooksIdJSONBodyEvents = "user.update.email.primary"
PutWebhooksIdJSONBodyEventsUserUpdateUsername PutWebhooksIdJSONBodyEvents = "user.update.username"
PutWebhooksIdJSONBodyEventsUserUpdateUsernameCreate PutWebhooksIdJSONBodyEvents = "user.update.username.create"
PutWebhooksIdJSONBodyEventsUserUpdateUsernameDelete PutWebhooksIdJSONBodyEvents = "user.update.username.delete"
PutWebhooksIdJSONBodyEventsUserUpdateUsernameUpdate PutWebhooksIdJSONBodyEvents = "user.update.username.update"
)
// AuditLog defines model for AuditLog.
type AuditLog struct {
// ActorEmail The email from the actor
ActorEmail *openapi_types.Email `json:"actor_email,omitempty"`
// ActorUserId The userID from the actor
ActorUserId *UUID4 `json:"actor_user_id,omitempty"`
// CreatedAt Time of creation of the audit log
CreatedAt time.Time `json:"created_at"`
// Error A more detailed message why something failed
Error *string `json:"error,omitempty"`
// Id The ID of the audit log
Id UUID4 `json:"id"`
// MetaHttpRequestId The ID of the corresponding http request
MetaHttpRequestId string `json:"meta_http_request_id"`
// MetaSourceIp The IP from where the http request came from
MetaSourceIp string `json:"meta_source_ip"`
// MetaUserAgent The user agent from where the http request came from
MetaUserAgent string `json:"meta_user_agent"`
Type AuditLogTypes `json:"type"`
}
// AuditLogTypes The type of the audit log
type AuditLogTypes string
// CreatePassword defines model for CreatePassword.
type CreatePassword struct {
Password *string `json:"password,omitempty"`
}
// CreateSession defines model for CreateSession.
type CreateSession struct {
IpAddress *string `json:"ip_address,omitempty"`
UserAgent *string `json:"user_agent,omitempty"`
UserId openapi_types.UUID `json:"user_id"`
}
// CreateSessionResponse defines model for CreateSessionResponse.
type CreateSessionResponse struct {
SessionToken *string `json:"session_token,omitempty"`
}
// DatabaseWebhook defines model for DatabaseWebhook.
type DatabaseWebhook struct {
Callback *string `json:"callback,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Events *[]DatabaseWebhookEvent `json:"events,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
Failures *int `json:"failures,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
// UpdatedAt Time of last update of the audit log
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
// DatabaseWebhookEvent defines model for DatabaseWebhookEvent.
type DatabaseWebhookEvent struct {
Event *DatabaseWebhookEventEvent `json:"event,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
}
// DatabaseWebhookEventEvent defines model for DatabaseWebhookEvent.Event.
type DatabaseWebhookEventEvent string
// Email defines model for Email.
type Email struct {
// Address The email address
Address openapi_types.Email `json:"address"`
// CreatedAt Time of creation of the email
CreatedAt time.Time `json:"created_at"`
// Id The ID of the email
Id UUID4 `json:"id"`
// IsPrimary Indicates it's the primary email address.
IsPrimary bool `json:"is_primary"`
// IsVerified Indicated the email has been verified.
IsVerified bool `json:"is_verified"`
// UpdatedAt Time of last update of the email
UpdatedAt time.Time `json:"updated_at"`
}
// Error defines model for Error.
type Error struct {
Code int32 `json:"code"`
Message string `json:"message"`
}
// Identities A list of third party provider identities
type Identities = []Identity
// Identity A third party provider identity
type Identity struct {
// CreatedAt Time of creation of the password credential
CreatedAt *time.Time `json:"created_at,omitempty"`
// EmailId The ID of the email this identity is coupled with
EmailId *UUID4 `json:"email_id,omitempty"`
// Id The ID of the identity
Id *UUID4 `json:"id,omitempty"`
// ProviderId The user's third party provider account/user ID
ProviderId *string `json:"provider_id,omitempty"`
// ProviderName The name of the third party provider this identity coupled with
ProviderName *string `json:"provider_name,omitempty"`
// UpdatedAt Time of last update of the password credential
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
// OTP defines model for OTP.
type OTP struct {
CreatedAt time.Time `json:"created_at"`
Id openapi_types.UUID `json:"id"`
}
// Password The password credential of a user
type Password struct {
// CreatedAt Time of creation of the password credential
CreatedAt *time.Time `json:"created_at,omitempty"`
// Id The ID of the password credential
Id *UUID4 `json:"id,omitempty"`
// UpdatedAt Time of last update of the password credential
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
// Session defines model for Session.
type Session struct {
CreatedAt time.Time `json:"created_at"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
Id openapi_types.UUID `json:"id"`
IpAddress *string `json:"ip_address,omitempty"`
LastUsed time.Time `json:"last_used"`
UpdatedAt time.Time `json:"updated_at"`
UserAgent *string `json:"user_agent,omitempty"`
UserId openapi_types.UUID `json:"user_id"`
}
// UUID4 defines model for UUID4.
type UUID4 = string
// User defines model for User.
type User struct {
// CreatedAt Time of creation of the user
CreatedAt time.Time `json:"created_at"`
// Emails List of emails associated to the user
Emails *[]Email `json:"emails,omitempty"`
// Id The ID of the user
Id UUID4 `json:"id"`
// Identities A list of third party provider identities
Identities *Identities `json:"identities,omitempty"`
// Metadata User metadata
Metadata *UserMetadata `json:"metadata,omitempty"`
Otp *OTP `json:"otp,omitempty"`
// Password The password credential of a user
Password *Password `json:"password,omitempty"`
// UpdatedAt Time of last update of the user
UpdatedAt time.Time `json:"updated_at"`
// Username The username of the user
Username *Username `json:"username,omitempty"`
// WebauthnCredentials List of registered Webauthn credentials
WebauthnCredentials *[]WebAuthnCredential `json:"webauthn_credentials,omitempty"`
}
// UserBase defines model for UserBase.
type UserBase struct {
// CreatedAt Time of creation of the user
CreatedAt time.Time `json:"created_at"`
// Emails List of emails associated to the user
Emails *[]Email `json:"emails,omitempty"`
// Id The ID of the user
Id UUID4 `json:"id"`
// UpdatedAt Time of last update of the user
UpdatedAt time.Time `json:"updated_at"`
// Username The username of the user
Username *Username `json:"username,omitempty"`
// WebauthnCredentials List of registered Webauthn credentials
WebauthnCredentials *[]WebAuthnCredential `json:"webauthn_credentials,omitempty"`
}
// UserMetadata User metadata
type UserMetadata struct {
PrivateMetadata *map[string]interface{} `json:"private_metadata,omitempty"`
PublicMetadata *map[string]interface{} `json:"public_metadata,omitempty"`
UnsafeMetadata *map[string]interface{} `json:"unsafe_metadata,omitempty"`
}
// Username The username of the user
type Username struct {
// CreatedAt Time of creation of the username
CreatedAt *time.Time `json:"created_at,omitempty"`
// Id The ID of the username
Id *UUID4 `json:"id,omitempty"`
// UpdatedAt Time of last update of the username
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
// WebAuthnCredential defines model for WebAuthnCredential.
type WebAuthnCredential struct {
// Aaguid The AAGUID of the authenticator the credentials was created on
Aaguid string `json:"aaguid"`
// AttestationType The attestation type the credential was registered with
AttestationType string `json:"attestation_type"`
// BackupEligible Indicates if the credential can be backed up
BackupEligible bool `json:"backup_eligible"`
// BackupState Indicates if the credential is backed up
BackupState bool `json:"backup_state"`
// CreatedAt Time of creation of the credential
CreatedAt time.Time `json:"created_at"`
// Id The ID of the credential
Id UUID4 `json:"id"`
// LastUsedAt The time when the credential was last used
LastUsedAt *time.Time `json:"last_used_at,omitempty"`
// MfaOnly Indicates if the credential can only be used as a MFA credential
MfaOnly bool `json:"mfa_only"`
// Name A name that the user choose
Name *string `json:"name,omitempty"`
// PublicKey The public key of the credential
PublicKey string `json:"public_key"`
// Transports The ways the authenticator is connected
Transports *[]string `json:"transports,omitempty"`
}
// Webhook defines model for Webhook.
type Webhook struct {
Callback string `json:"callback"`
Events []WebhookEvents `json:"events"`
}
// WebhookEvents defines model for Webhook.Events.
type WebhookEvents string
// Id defines model for Id.
type Id = openapi_types.UUID
// BadRequest defines model for BadRequest.
type BadRequest = Error
// Conflict defines model for Conflict.
type Conflict = Error
// InternalServerError defines model for InternalServerError.
type InternalServerError = Error
// NotFound defines model for NotFound.
type NotFound = Error
// CreateEmail defines model for CreateEmail.
type CreateEmail struct {
Address openapi_types.Email `json:"address"`
IsPrimary *bool `json:"is_primary,omitempty"`
IsVerified *bool `json:"is_verified,omitempty"`
}
// ListAuditLogsParams defines parameters for ListAuditLogs.
type ListAuditLogsParams struct {
// Page The page which should be returned
Page *int `form:"page,omitempty" json:"page,omitempty"`
// PerPage The number of returned items
PerPage *int `form:"per_page,omitempty" json:"per_page,omitempty"`
// StartTime Date and time from which the logs are included
StartTime *string `form:"start_time,omitempty" json:"start_time,omitempty"`
// EndTime Date and time to which the logs are included
EndTime *string `form:"end_time,omitempty" json:"end_time,omitempty"`
// ActorUserId Only audit logs with the specified user_id are included
ActorUserId *UUID4 `form:"actor_user_id,omitempty" json:"actor_user_id,omitempty"`
// ActorEmail Only audit logs with the specified email are included
ActorEmail *openapi_types.Email `form:"actor_email,omitempty" json:"actor_email,omitempty"`
// Q Only audit logs are included when the search string matches values in meta_source_ip or actor_user_id or actor_email
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Type Only audit logs with the specified type are included
Type *[]AuditLogTypes `form:"type,omitempty" json:"type,omitempty"`
}
// ListUsersParams defines parameters for ListUsers.
type ListUsersParams struct {
// Page The page which should be returned
Page *int `form:"page,omitempty" json:"page,omitempty"`
// PerPage The number of returned items
PerPage *int `form:"per_page,omitempty" json:"per_page,omitempty"`
// UserId A single ID or a comma-separated list of IDs. Only users with the specified IDs are included in the result.
UserId *UUID4 `form:"user_id,omitempty" json:"user_id,omitempty"`
// Email Only users with the specified email are included
Email *openapi_types.Email `form:"email,omitempty" json:"email,omitempty"`
// SortDirection The sort direction of the returned list (always sorted by created_at)
SortDirection *ListUsersParamsSortDirection `form:"sort_direction,omitempty" json:"sort_direction,omitempty"`
}
// ListUsersParamsSortDirection defines parameters for ListUsers.
type ListUsersParamsSortDirection string
// CreateUserJSONBody defines parameters for CreateUser.
type CreateUserJSONBody struct {
// CreatedAt Time of creation of the user
CreatedAt *time.Time `json:"created_at,omitempty"`
// Emails The email addresses of the new user
Emails []struct {
Address string `json:"address"`
IsPrimary bool `json:"is_primary"`
IsVerified *bool `json:"is_verified,omitempty"`
} `json:"emails"`
// Id The ID of the new user
Id *UUID4 `json:"id,omitempty"`
// Username The username of the new user
Username *string `json:"username,omitempty"`
}
// PostUsersIdEmailsJSONBody defines parameters for PostUsersIdEmails.
type PostUsersIdEmailsJSONBody struct {
Address openapi_types.Email `json:"address"`
IsPrimary *bool `json:"is_primary,omitempty"`
IsVerified *bool `json:"is_verified,omitempty"`
}
// PatchUserMetadataJSONBody defines parameters for PatchUserMetadata.
type PatchUserMetadataJSONBody struct {
PrivateMetadata *map[string]interface{} `json:"private_metadata,omitempty"`
PublicMetadata *map[string]interface{} `json:"public_metadata,omitempty"`
UnsafeMetadata *map[string]interface{} `json:"unsafe_metadata,omitempty"`
}
// PutWebhooksIdJSONBody defines parameters for PutWebhooksId.
type PutWebhooksIdJSONBody struct {
Callback string `json:"callback"`
Enabled bool `json:"enabled"`
Events []PutWebhooksIdJSONBodyEvents `json:"events"`
}
// PutWebhooksIdJSONBodyEvents defines parameters for PutWebhooksId.
type PutWebhooksIdJSONBodyEvents string
// PostSessionsJSONRequestBody defines body for PostSessions for application/json ContentType.
type PostSessionsJSONRequestBody = CreateSession
// CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserJSONRequestBody CreateUserJSONBody
// PostUsersIdEmailsJSONRequestBody defines body for PostUsersIdEmails for application/json ContentType.
type PostUsersIdEmailsJSONRequestBody PostUsersIdEmailsJSONBody
// PatchUserMetadataJSONRequestBody defines body for PatchUserMetadata for application/json ContentType.
type PatchUserMetadataJSONRequestBody PatchUserMetadataJSONBody
// PostUsersPasswordJSONRequestBody defines body for PostUsersPassword for application/json ContentType.
type PostUsersPasswordJSONRequestBody = CreatePassword
// PutUsersPasswordJSONRequestBody defines body for PutUsersPassword for application/json ContentType.
type PutUsersPasswordJSONRequestBody = CreatePassword
// CreateDbWebhooksJSONRequestBody defines body for CreateDbWebhooks for application/json ContentType.
type CreateDbWebhooksJSONRequestBody = Webhook
// PutWebhooksIdJSONRequestBody defines body for PutWebhooksId for application/json ContentType.
type PutWebhooksIdJSONRequestBody PutWebhooksIdJSONBody
// RequestEditorFn is the function signature for the RequestEditor callback function
type RequestEditorFn func(ctx context.Context, req *http.Request) error
// Doer performs HTTP requests.
//
// The standard http.Client implements this interface.
type HttpRequestDoer interface {
Do(req *http.Request) (*http.Response, error)
}
// Client which conforms to the OpenAPI3 specification for this service.
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
// ClientOption allows setting custom parameters during construction
type ClientOption func(*Client) error
// Creates a new Client, with reasonable defaults
func NewClient(server string, opts ...ClientOption) (*Client, error) {
// create a client with sane default values
client := Client{
Server: server,
}
// mutate client and add all optional params
for _, o := range opts {
if err := o(&client); err != nil {
return nil, err
}
}
// ensure the server URL always has a trailing slash
if !strings.HasSuffix(client.Server, "/") {
client.Server += "/"
}
// create httpClient, if not already present
if client.Client == nil {
client.Client = &http.Client{}
}
return &client, nil
}
// WithHTTPClient allows overriding the default Doer, which is
// automatically created using http.Client. This is useful for tests.
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
return func(c *Client) error {
c.Client = doer
return nil
}
}
// WithRequestEditorFn allows setting up a callback function, which will be
// called right before sending the request. This can be used to mutate the request.
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
return func(c *Client) error {
c.RequestEditors = append(c.RequestEditors, fn)
return nil
}
}
// The interface specification for the client above.
type ClientInterface interface {
// Status request
Status(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListAuditLogs request
ListAuditLogs(ctx context.Context, params *ListAuditLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetMetrics request
GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostSessionsWithBody request with any body
PostSessionsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostSessions(ctx context.Context, body PostSessionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListUsers request
ListUsers(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateUserWithBody request with any body
CreateUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateUser(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUser request
DeleteUser(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUser request
GetUser(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersIdEmails request
GetUsersIdEmails(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostUsersIdEmailsWithBody request with any body
PostUsersIdEmailsWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostUsersIdEmails(ctx context.Context, id Id, body PostUsersIdEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUsersEmailsEmailId request
DeleteUsersEmailsEmailId(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersIdEmailsEmailId request
GetUsersIdEmailsEmailId(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostUsersEmailsEmailIdSetPrimary request
PostUsersEmailsEmailIdSetPrimary(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUserMetadata request
GetUserMetadata(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// PatchUserMetadataWithBody request with any body
PatchUserMetadataWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchUserMetadata(ctx context.Context, id Id, body PatchUserMetadataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUsersOtp request
DeleteUsersOtp(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersOtp request
GetUsersOtp(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUsersPassword request
DeleteUsersPassword(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersPassword request
GetUsersPassword(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostUsersPasswordWithBody request with any body
PostUsersPasswordWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostUsersPassword(ctx context.Context, id Id, body PostUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutUsersPasswordWithBody request with any body
PutUsersPasswordWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PutUsersPassword(ctx context.Context, id Id, body PutUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersSessions request
GetUsersSessions(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUsersSessionsSessionId request
DeleteUsersSessionsSessionId(ctx context.Context, id Id, sessionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersWebauthnCredentials request
GetUsersWebauthnCredentials(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteUsersWebauthnCredentialsCredentialId request
DeleteUsersWebauthnCredentialsCredentialId(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetUsersWebauthnCredentialsCredentialId request
GetUsersWebauthnCredentialsCredentialId(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListWebhooks request
ListWebhooks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateDbWebhooksWithBody request with any body
CreateDbWebhooksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateDbWebhooks(ctx context.Context, body CreateDbWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteWebhooksId request
DeleteWebhooksId(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetWebhooksId request
GetWebhooksId(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutWebhooksIdWithBody request with any body
PutWebhooksIdWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PutWebhooksId(ctx context.Context, id Id, body PutWebhooksIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
func (c *Client) Status(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewStatusRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) ListAuditLogs(ctx context.Context, params *ListAuditLogsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListAuditLogsRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetMetricsRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostSessionsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostSessionsRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostSessions(ctx context.Context, body PostSessionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostSessionsRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) ListUsers(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListUsersRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) CreateUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateUserRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) CreateUser(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateUserRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteUser(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteUserRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUser(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUserRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersIdEmails(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersIdEmailsRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostUsersIdEmailsWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostUsersIdEmailsRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostUsersIdEmails(ctx context.Context, id Id, body PostUsersIdEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostUsersIdEmailsRequest(c.Server, id, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteUsersEmailsEmailId(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteUsersEmailsEmailIdRequest(c.Server, id, emailId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersIdEmailsEmailId(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersIdEmailsEmailIdRequest(c.Server, id, emailId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostUsersEmailsEmailIdSetPrimary(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostUsersEmailsEmailIdSetPrimaryRequest(c.Server, id, emailId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUserMetadata(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUserMetadataRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PatchUserMetadataWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPatchUserMetadataRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PatchUserMetadata(ctx context.Context, id Id, body PatchUserMetadataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPatchUserMetadataRequest(c.Server, id, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteUsersOtp(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteUsersOtpRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersOtp(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersOtpRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteUsersPassword(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteUsersPasswordRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersPassword(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersPasswordRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostUsersPasswordWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostUsersPasswordRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PostUsersPassword(ctx context.Context, id Id, body PostUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostUsersPasswordRequest(c.Server, id, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PutUsersPasswordWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPutUsersPasswordRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PutUsersPassword(ctx context.Context, id Id, body PutUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPutUsersPasswordRequest(c.Server, id, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersSessions(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersSessionsRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteUsersSessionsSessionId(ctx context.Context, id Id, sessionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteUsersSessionsSessionIdRequest(c.Server, id, sessionId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersWebauthnCredentials(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersWebauthnCredentialsRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteUsersWebauthnCredentialsCredentialId(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteUsersWebauthnCredentialsCredentialIdRequest(c.Server, id, credentialId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetUsersWebauthnCredentialsCredentialId(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetUsersWebauthnCredentialsCredentialIdRequest(c.Server, id, credentialId)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) ListWebhooks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListWebhooksRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) CreateDbWebhooksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateDbWebhooksRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) CreateDbWebhooks(ctx context.Context, body CreateDbWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateDbWebhooksRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) DeleteWebhooksId(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteWebhooksIdRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetWebhooksId(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetWebhooksIdRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PutWebhooksIdWithBody(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPutWebhooksIdRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PutWebhooksId(ctx context.Context, id Id, body PutWebhooksIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPutWebhooksIdRequest(c.Server, id, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// NewStatusRequest generates requests for Status
func NewStatusRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewListAuditLogsRequest generates requests for ListAuditLogs
func NewListAuditLogsRequest(server string, params *ListAuditLogsParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/audit_logs")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
queryValues := queryURL.Query()
if params.Page != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.PerPage != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.StartTime != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "start_time", runtime.ParamLocationQuery, *params.StartTime); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.EndTime != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "end_time", runtime.ParamLocationQuery, *params.EndTime); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.ActorUserId != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "actor_user_id", runtime.ParamLocationQuery, *params.ActorUserId); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.ActorEmail != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "actor_email", runtime.ParamLocationQuery, *params.ActorEmail); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.Q != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.Type != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
queryURL.RawQuery = queryValues.Encode()
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetMetricsRequest generates requests for GetMetrics
func NewGetMetricsRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/metrics")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPostSessionsRequest calls the generic PostSessions builder with application/json body
func NewPostSessionsRequest(server string, body PostSessionsJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPostSessionsRequestWithBody(server, "application/json", bodyReader)
}
// NewPostSessionsRequestWithBody generates requests for PostSessions with any type of body
func NewPostSessionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/sessions")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewListUsersRequest generates requests for ListUsers
func NewListUsersRequest(server string, params *ListUsersParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
queryValues := queryURL.Query()
if params.Page != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.PerPage != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "per_page", runtime.ParamLocationQuery, *params.PerPage); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.UserId != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "user_id", runtime.ParamLocationQuery, *params.UserId); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.Email != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "email", runtime.ParamLocationQuery, *params.Email); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.SortDirection != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort_direction", runtime.ParamLocationQuery, *params.SortDirection); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
queryURL.RawQuery = queryValues.Encode()
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewCreateUserRequest calls the generic CreateUser builder with application/json body
func NewCreateUserRequest(server string, body CreateUserJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCreateUserRequestWithBody(server, "application/json", bodyReader)
}
// NewCreateUserRequestWithBody generates requests for CreateUser with any type of body
func NewCreateUserRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDeleteUserRequest generates requests for DeleteUser
func NewDeleteUserRequest(server string, id UUID4) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUserRequest generates requests for GetUser
func NewGetUserRequest(server string, id UUID4) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUsersIdEmailsRequest generates requests for GetUsersIdEmails
func NewGetUsersIdEmailsRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/emails", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPostUsersIdEmailsRequest calls the generic PostUsersIdEmails builder with application/json body
func NewPostUsersIdEmailsRequest(server string, id Id, body PostUsersIdEmailsJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPostUsersIdEmailsRequestWithBody(server, id, "application/json", bodyReader)
}
// NewPostUsersIdEmailsRequestWithBody generates requests for PostUsersIdEmails with any type of body
func NewPostUsersIdEmailsRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/emails", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDeleteUsersEmailsEmailIdRequest generates requests for DeleteUsersEmailsEmailId
func NewDeleteUsersEmailsEmailIdRequest(server string, id Id, emailId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
var pathParam1 string
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "email_id", runtime.ParamLocationPath, emailId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/emails/%s", pathParam0, pathParam1)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUsersIdEmailsEmailIdRequest generates requests for GetUsersIdEmailsEmailId
func NewGetUsersIdEmailsEmailIdRequest(server string, id Id, emailId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
var pathParam1 string
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "email_id", runtime.ParamLocationPath, emailId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/emails/%s", pathParam0, pathParam1)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPostUsersEmailsEmailIdSetPrimaryRequest generates requests for PostUsersEmailsEmailIdSetPrimary
func NewPostUsersEmailsEmailIdSetPrimaryRequest(server string, id Id, emailId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
var pathParam1 string
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "email_id", runtime.ParamLocationPath, emailId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/emails/%s/set_primary", pathParam0, pathParam1)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUserMetadataRequest generates requests for GetUserMetadata
func NewGetUserMetadataRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/metadata", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPatchUserMetadataRequest calls the generic PatchUserMetadata builder with application/json body
func NewPatchUserMetadataRequest(server string, id Id, body PatchUserMetadataJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPatchUserMetadataRequestWithBody(server, id, "application/json", bodyReader)
}
// NewPatchUserMetadataRequestWithBody generates requests for PatchUserMetadata with any type of body
func NewPatchUserMetadataRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/metadata", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("PATCH", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDeleteUsersOtpRequest generates requests for DeleteUsersOtp
func NewDeleteUsersOtpRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/otp", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUsersOtpRequest generates requests for GetUsersOtp
func NewGetUsersOtpRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/otp", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewDeleteUsersPasswordRequest generates requests for DeleteUsersPassword
func NewDeleteUsersPasswordRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/password", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUsersPasswordRequest generates requests for GetUsersPassword
func NewGetUsersPasswordRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/password", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPostUsersPasswordRequest calls the generic PostUsersPassword builder with application/json body
func NewPostUsersPasswordRequest(server string, id Id, body PostUsersPasswordJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPostUsersPasswordRequestWithBody(server, id, "application/json", bodyReader)
}
// NewPostUsersPasswordRequestWithBody generates requests for PostUsersPassword with any type of body
func NewPostUsersPasswordRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/password", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewPutUsersPasswordRequest calls the generic PutUsersPassword builder with application/json body
func NewPutUsersPasswordRequest(server string, id Id, body PutUsersPasswordJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPutUsersPasswordRequestWithBody(server, id, "application/json", bodyReader)
}
// NewPutUsersPasswordRequestWithBody generates requests for PutUsersPassword with any type of body
func NewPutUsersPasswordRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/password", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("PUT", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetUsersSessionsRequest generates requests for GetUsersSessions
func NewGetUsersSessionsRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/sessions", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewDeleteUsersSessionsSessionIdRequest generates requests for DeleteUsersSessionsSessionId
func NewDeleteUsersSessionsSessionIdRequest(server string, id Id, sessionId openapi_types.UUID) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
var pathParam1 string
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "session_id", runtime.ParamLocationPath, sessionId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/sessions/%s", pathParam0, pathParam1)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUsersWebauthnCredentialsRequest generates requests for GetUsersWebauthnCredentials
func NewGetUsersWebauthnCredentialsRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/webauthn_credentials", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewDeleteUsersWebauthnCredentialsCredentialIdRequest generates requests for DeleteUsersWebauthnCredentialsCredentialId
func NewDeleteUsersWebauthnCredentialsCredentialIdRequest(server string, id Id, credentialId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
var pathParam1 string
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "credential_id", runtime.ParamLocationPath, credentialId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/webauthn_credentials/%s", pathParam0, pathParam1)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetUsersWebauthnCredentialsCredentialIdRequest generates requests for GetUsersWebauthnCredentialsCredentialId
func NewGetUsersWebauthnCredentialsCredentialIdRequest(server string, id Id, credentialId string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
var pathParam1 string
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "credential_id", runtime.ParamLocationPath, credentialId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/users/%s/webauthn_credentials/%s", pathParam0, pathParam1)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewListWebhooksRequest generates requests for ListWebhooks
func NewListWebhooksRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/webhooks")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewCreateDbWebhooksRequest calls the generic CreateDbWebhooks builder with application/json body
func NewCreateDbWebhooksRequest(server string, body CreateDbWebhooksJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCreateDbWebhooksRequestWithBody(server, "application/json", bodyReader)
}
// NewCreateDbWebhooksRequestWithBody generates requests for CreateDbWebhooks with any type of body
func NewCreateDbWebhooksRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/webhooks")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDeleteWebhooksIdRequest generates requests for DeleteWebhooksId
func NewDeleteWebhooksIdRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/webhooks/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetWebhooksIdRequest generates requests for GetWebhooksId
func NewGetWebhooksIdRequest(server string, id Id) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/webhooks/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPutWebhooksIdRequest calls the generic PutWebhooksId builder with application/json body
func NewPutWebhooksIdRequest(server string, id Id, body PutWebhooksIdJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPutWebhooksIdRequestWithBody(server, id, "application/json", bodyReader)
}
// NewPutWebhooksIdRequestWithBody generates requests for PutWebhooksId with any type of body
func NewPutWebhooksIdRequestWithBody(server string, id Id, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/webhooks/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("PUT", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
for _, r := range c.RequestEditors {
if err := r(ctx, req); err != nil {
return err
}
}
for _, r := range additionalEditors {
if err := r(ctx, req); err != nil {
return err
}
}
return nil
}
// ClientWithResponses builds on ClientInterface to offer response payloads
type ClientWithResponses struct {
ClientInterface
}
// NewClientWithResponses creates a new ClientWithResponses, which wraps
// Client with return type handling
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
client, err := NewClient(server, opts...)
if err != nil {
return nil, err
}
return &ClientWithResponses{client}, nil
}
// WithBaseURL overrides the baseURL.
func WithBaseURL(baseURL string) ClientOption {
return func(c *Client) error {
newBaseURL, err := url.Parse(baseURL)
if err != nil {
return err
}
c.Server = newBaseURL.String()
return nil
}
}
// ClientWithResponsesInterface is the interface specification for the client with responses above.
type ClientWithResponsesInterface interface {
// StatusWithResponse request
StatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*StatusResponse, error)
// ListAuditLogsWithResponse request
ListAuditLogsWithResponse(ctx context.Context, params *ListAuditLogsParams, reqEditors ...RequestEditorFn) (*ListAuditLogsResponse, error)
// GetMetricsWithResponse request
GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error)
// PostSessionsWithBodyWithResponse request with any body
PostSessionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionsResponse, error)
PostSessionsWithResponse(ctx context.Context, body PostSessionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionsResponse, error)
// ListUsersWithResponse request
ListUsersWithResponse(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*ListUsersResponse, error)
// CreateUserWithBodyWithResponse request with any body
CreateUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)
CreateUserWithResponse(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)
// DeleteUserWithResponse request
DeleteUserWithResponse(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error)
// GetUserWithResponse request
GetUserWithResponse(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*GetUserResponse, error)
// GetUsersIdEmailsWithResponse request
GetUsersIdEmailsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersIdEmailsResponse, error)
// PostUsersIdEmailsWithBodyWithResponse request with any body
PostUsersIdEmailsWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUsersIdEmailsResponse, error)
PostUsersIdEmailsWithResponse(ctx context.Context, id Id, body PostUsersIdEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUsersIdEmailsResponse, error)
// DeleteUsersEmailsEmailIdWithResponse request
DeleteUsersEmailsEmailIdWithResponse(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*DeleteUsersEmailsEmailIdResponse, error)
// GetUsersIdEmailsEmailIdWithResponse request
GetUsersIdEmailsEmailIdWithResponse(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*GetUsersIdEmailsEmailIdResponse, error)
// PostUsersEmailsEmailIdSetPrimaryWithResponse request
PostUsersEmailsEmailIdSetPrimaryWithResponse(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*PostUsersEmailsEmailIdSetPrimaryResponse, error)
// GetUserMetadataWithResponse request
GetUserMetadataWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUserMetadataResponse, error)
// PatchUserMetadataWithBodyWithResponse request with any body
PatchUserMetadataWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUserMetadataResponse, error)
PatchUserMetadataWithResponse(ctx context.Context, id Id, body PatchUserMetadataJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUserMetadataResponse, error)
// DeleteUsersOtpWithResponse request
DeleteUsersOtpWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*DeleteUsersOtpResponse, error)
// GetUsersOtpWithResponse request
GetUsersOtpWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersOtpResponse, error)
// DeleteUsersPasswordWithResponse request
DeleteUsersPasswordWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*DeleteUsersPasswordResponse, error)
// GetUsersPasswordWithResponse request
GetUsersPasswordWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersPasswordResponse, error)
// PostUsersPasswordWithBodyWithResponse request with any body
PostUsersPasswordWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUsersPasswordResponse, error)
PostUsersPasswordWithResponse(ctx context.Context, id Id, body PostUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUsersPasswordResponse, error)
// PutUsersPasswordWithBodyWithResponse request with any body
PutUsersPasswordWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutUsersPasswordResponse, error)
PutUsersPasswordWithResponse(ctx context.Context, id Id, body PutUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*PutUsersPasswordResponse, error)
// GetUsersSessionsWithResponse request
GetUsersSessionsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersSessionsResponse, error)
// DeleteUsersSessionsSessionIdWithResponse request
DeleteUsersSessionsSessionIdWithResponse(ctx context.Context, id Id, sessionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteUsersSessionsSessionIdResponse, error)
// GetUsersWebauthnCredentialsWithResponse request
GetUsersWebauthnCredentialsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersWebauthnCredentialsResponse, error)
// DeleteUsersWebauthnCredentialsCredentialIdWithResponse request
DeleteUsersWebauthnCredentialsCredentialIdWithResponse(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*DeleteUsersWebauthnCredentialsCredentialIdResponse, error)
// GetUsersWebauthnCredentialsCredentialIdWithResponse request
GetUsersWebauthnCredentialsCredentialIdWithResponse(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*GetUsersWebauthnCredentialsCredentialIdResponse, error)
// ListWebhooksWithResponse request
ListWebhooksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWebhooksResponse, error)
// CreateDbWebhooksWithBodyWithResponse request with any body
CreateDbWebhooksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDbWebhooksResponse, error)
CreateDbWebhooksWithResponse(ctx context.Context, body CreateDbWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDbWebhooksResponse, error)
// DeleteWebhooksIdWithResponse request
DeleteWebhooksIdWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*DeleteWebhooksIdResponse, error)
// GetWebhooksIdWithResponse request
GetWebhooksIdWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetWebhooksIdResponse, error)
// PutWebhooksIdWithBodyWithResponse request with any body
PutWebhooksIdWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutWebhooksIdResponse, error)
PutWebhooksIdWithResponse(ctx context.Context, id Id, body PutWebhooksIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutWebhooksIdResponse, error)
}
type StatusResponse struct {
Body []byte
HTTPResponse *http.Response
}
// Status returns HTTPResponse.Status
func (r StatusResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r StatusResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type ListAuditLogsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]AuditLog
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r ListAuditLogsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListAuditLogsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetMetricsResponse struct {
Body []byte
HTTPResponse *http.Response
}
// Status returns HTTPResponse.Status
func (r GetMetricsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetMetricsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PostSessionsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *CreateSessionResponse
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PostSessionsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PostSessionsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type ListUsersResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]UserBase
JSON400 *BadRequest
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r ListUsersResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListUsersResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type CreateUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *User
JSON400 *BadRequest
JSON409 *Conflict
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r CreateUserResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CreateUserResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r DeleteUserResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUserResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUserResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *User
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUserResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUserResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersIdEmailsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Email
JSON400 *BadRequest
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersIdEmailsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersIdEmailsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PostUsersIdEmailsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Email
JSON400 *BadRequest
JSON404 *NotFound
JSON409 *Conflict
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PostUsersIdEmailsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PostUsersIdEmailsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteUsersEmailsEmailIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON409 *Conflict
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r DeleteUsersEmailsEmailIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUsersEmailsEmailIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersIdEmailsEmailIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Email
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersIdEmailsEmailIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersIdEmailsEmailIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PostUsersEmailsEmailIdSetPrimaryResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PostUsersEmailsEmailIdSetPrimaryResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PostUsersEmailsEmailIdSetPrimaryResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUserMetadataResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *UserMetadata
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUserMetadataResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUserMetadataResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PatchUserMetadataResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *UserMetadata
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PatchUserMetadataResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PatchUserMetadataResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteUsersOtpResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r DeleteUsersOtpResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUsersOtpResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersOtpResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *OTP
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersOtpResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersOtpResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteUsersPasswordResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r DeleteUsersPasswordResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUsersPasswordResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersPasswordResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Password
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersPasswordResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersPasswordResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PostUsersPasswordResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Password
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PostUsersPasswordResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PostUsersPasswordResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PutUsersPasswordResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Password
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PutUsersPasswordResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PutUsersPasswordResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersSessionsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]Session
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersSessionsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersSessionsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteUsersSessionsSessionIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r DeleteUsersSessionsSessionIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUsersSessionsSessionIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersWebauthnCredentialsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]WebAuthnCredential
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersWebauthnCredentialsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersWebauthnCredentialsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteUsersWebauthnCredentialsCredentialIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r DeleteUsersWebauthnCredentialsCredentialIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUsersWebauthnCredentialsCredentialIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetUsersWebauthnCredentialsCredentialIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *WebAuthnCredential
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetUsersWebauthnCredentialsCredentialIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetUsersWebauthnCredentialsCredentialIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type ListWebhooksResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *struct {
Config *[]Webhook `json:"config,omitempty"`
Database *[]DatabaseWebhook `json:"database,omitempty"`
}
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r ListWebhooksResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListWebhooksResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type CreateDbWebhooksResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *DatabaseWebhook
JSON400 *BadRequest
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r CreateDbWebhooksResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CreateDbWebhooksResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type DeleteWebhooksIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *BadRequest
JSON404 *NotFound
}
// Status returns HTTPResponse.Status
func (r DeleteWebhooksIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteWebhooksIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type GetWebhooksIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *DatabaseWebhook
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r GetWebhooksIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetWebhooksIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
type PutWebhooksIdResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *DatabaseWebhook
JSON400 *BadRequest
JSON404 *NotFound
JSON500 *InternalServerError
}
// Status returns HTTPResponse.Status
func (r PutWebhooksIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PutWebhooksIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// StatusWithResponse request returning *StatusResponse
func (c *ClientWithResponses) StatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*StatusResponse, error) {
rsp, err := c.Status(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseStatusResponse(rsp)
}
// ListAuditLogsWithResponse request returning *ListAuditLogsResponse
func (c *ClientWithResponses) ListAuditLogsWithResponse(ctx context.Context, params *ListAuditLogsParams, reqEditors ...RequestEditorFn) (*ListAuditLogsResponse, error) {
rsp, err := c.ListAuditLogs(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseListAuditLogsResponse(rsp)
}
// GetMetricsWithResponse request returning *GetMetricsResponse
func (c *ClientWithResponses) GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error) {
rsp, err := c.GetMetrics(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetMetricsResponse(rsp)
}
// PostSessionsWithBodyWithResponse request with arbitrary body returning *PostSessionsResponse
func (c *ClientWithResponses) PostSessionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionsResponse, error) {
rsp, err := c.PostSessionsWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostSessionsResponse(rsp)
}
func (c *ClientWithResponses) PostSessionsWithResponse(ctx context.Context, body PostSessionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSessionsResponse, error) {
rsp, err := c.PostSessions(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostSessionsResponse(rsp)
}
// ListUsersWithResponse request returning *ListUsersResponse
func (c *ClientWithResponses) ListUsersWithResponse(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*ListUsersResponse, error) {
rsp, err := c.ListUsers(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseListUsersResponse(rsp)
}
// CreateUserWithBodyWithResponse request with arbitrary body returning *CreateUserResponse
func (c *ClientWithResponses) CreateUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) {
rsp, err := c.CreateUserWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateUserResponse(rsp)
}
func (c *ClientWithResponses) CreateUserWithResponse(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) {
rsp, err := c.CreateUser(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateUserResponse(rsp)
}
// DeleteUserWithResponse request returning *DeleteUserResponse
func (c *ClientWithResponses) DeleteUserWithResponse(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error) {
rsp, err := c.DeleteUser(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteUserResponse(rsp)
}
// GetUserWithResponse request returning *GetUserResponse
func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, id UUID4, reqEditors ...RequestEditorFn) (*GetUserResponse, error) {
rsp, err := c.GetUser(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUserResponse(rsp)
}
// GetUsersIdEmailsWithResponse request returning *GetUsersIdEmailsResponse
func (c *ClientWithResponses) GetUsersIdEmailsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersIdEmailsResponse, error) {
rsp, err := c.GetUsersIdEmails(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersIdEmailsResponse(rsp)
}
// PostUsersIdEmailsWithBodyWithResponse request with arbitrary body returning *PostUsersIdEmailsResponse
func (c *ClientWithResponses) PostUsersIdEmailsWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUsersIdEmailsResponse, error) {
rsp, err := c.PostUsersIdEmailsWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostUsersIdEmailsResponse(rsp)
}
func (c *ClientWithResponses) PostUsersIdEmailsWithResponse(ctx context.Context, id Id, body PostUsersIdEmailsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUsersIdEmailsResponse, error) {
rsp, err := c.PostUsersIdEmails(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostUsersIdEmailsResponse(rsp)
}
// DeleteUsersEmailsEmailIdWithResponse request returning *DeleteUsersEmailsEmailIdResponse
func (c *ClientWithResponses) DeleteUsersEmailsEmailIdWithResponse(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*DeleteUsersEmailsEmailIdResponse, error) {
rsp, err := c.DeleteUsersEmailsEmailId(ctx, id, emailId, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteUsersEmailsEmailIdResponse(rsp)
}
// GetUsersIdEmailsEmailIdWithResponse request returning *GetUsersIdEmailsEmailIdResponse
func (c *ClientWithResponses) GetUsersIdEmailsEmailIdWithResponse(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*GetUsersIdEmailsEmailIdResponse, error) {
rsp, err := c.GetUsersIdEmailsEmailId(ctx, id, emailId, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersIdEmailsEmailIdResponse(rsp)
}
// PostUsersEmailsEmailIdSetPrimaryWithResponse request returning *PostUsersEmailsEmailIdSetPrimaryResponse
func (c *ClientWithResponses) PostUsersEmailsEmailIdSetPrimaryWithResponse(ctx context.Context, id Id, emailId string, reqEditors ...RequestEditorFn) (*PostUsersEmailsEmailIdSetPrimaryResponse, error) {
rsp, err := c.PostUsersEmailsEmailIdSetPrimary(ctx, id, emailId, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostUsersEmailsEmailIdSetPrimaryResponse(rsp)
}
// GetUserMetadataWithResponse request returning *GetUserMetadataResponse
func (c *ClientWithResponses) GetUserMetadataWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUserMetadataResponse, error) {
rsp, err := c.GetUserMetadata(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUserMetadataResponse(rsp)
}
// PatchUserMetadataWithBodyWithResponse request with arbitrary body returning *PatchUserMetadataResponse
func (c *ClientWithResponses) PatchUserMetadataWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchUserMetadataResponse, error) {
rsp, err := c.PatchUserMetadataWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePatchUserMetadataResponse(rsp)
}
func (c *ClientWithResponses) PatchUserMetadataWithResponse(ctx context.Context, id Id, body PatchUserMetadataJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchUserMetadataResponse, error) {
rsp, err := c.PatchUserMetadata(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePatchUserMetadataResponse(rsp)
}
// DeleteUsersOtpWithResponse request returning *DeleteUsersOtpResponse
func (c *ClientWithResponses) DeleteUsersOtpWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*DeleteUsersOtpResponse, error) {
rsp, err := c.DeleteUsersOtp(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteUsersOtpResponse(rsp)
}
// GetUsersOtpWithResponse request returning *GetUsersOtpResponse
func (c *ClientWithResponses) GetUsersOtpWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersOtpResponse, error) {
rsp, err := c.GetUsersOtp(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersOtpResponse(rsp)
}
// DeleteUsersPasswordWithResponse request returning *DeleteUsersPasswordResponse
func (c *ClientWithResponses) DeleteUsersPasswordWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*DeleteUsersPasswordResponse, error) {
rsp, err := c.DeleteUsersPassword(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteUsersPasswordResponse(rsp)
}
// GetUsersPasswordWithResponse request returning *GetUsersPasswordResponse
func (c *ClientWithResponses) GetUsersPasswordWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersPasswordResponse, error) {
rsp, err := c.GetUsersPassword(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersPasswordResponse(rsp)
}
// PostUsersPasswordWithBodyWithResponse request with arbitrary body returning *PostUsersPasswordResponse
func (c *ClientWithResponses) PostUsersPasswordWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostUsersPasswordResponse, error) {
rsp, err := c.PostUsersPasswordWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostUsersPasswordResponse(rsp)
}
func (c *ClientWithResponses) PostUsersPasswordWithResponse(ctx context.Context, id Id, body PostUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*PostUsersPasswordResponse, error) {
rsp, err := c.PostUsersPassword(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostUsersPasswordResponse(rsp)
}
// PutUsersPasswordWithBodyWithResponse request with arbitrary body returning *PutUsersPasswordResponse
func (c *ClientWithResponses) PutUsersPasswordWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutUsersPasswordResponse, error) {
rsp, err := c.PutUsersPasswordWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePutUsersPasswordResponse(rsp)
}
func (c *ClientWithResponses) PutUsersPasswordWithResponse(ctx context.Context, id Id, body PutUsersPasswordJSONRequestBody, reqEditors ...RequestEditorFn) (*PutUsersPasswordResponse, error) {
rsp, err := c.PutUsersPassword(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePutUsersPasswordResponse(rsp)
}
// GetUsersSessionsWithResponse request returning *GetUsersSessionsResponse
func (c *ClientWithResponses) GetUsersSessionsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersSessionsResponse, error) {
rsp, err := c.GetUsersSessions(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersSessionsResponse(rsp)
}
// DeleteUsersSessionsSessionIdWithResponse request returning *DeleteUsersSessionsSessionIdResponse
func (c *ClientWithResponses) DeleteUsersSessionsSessionIdWithResponse(ctx context.Context, id Id, sessionId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteUsersSessionsSessionIdResponse, error) {
rsp, err := c.DeleteUsersSessionsSessionId(ctx, id, sessionId, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteUsersSessionsSessionIdResponse(rsp)
}
// GetUsersWebauthnCredentialsWithResponse request returning *GetUsersWebauthnCredentialsResponse
func (c *ClientWithResponses) GetUsersWebauthnCredentialsWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetUsersWebauthnCredentialsResponse, error) {
rsp, err := c.GetUsersWebauthnCredentials(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersWebauthnCredentialsResponse(rsp)
}
// DeleteUsersWebauthnCredentialsCredentialIdWithResponse request returning *DeleteUsersWebauthnCredentialsCredentialIdResponse
func (c *ClientWithResponses) DeleteUsersWebauthnCredentialsCredentialIdWithResponse(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*DeleteUsersWebauthnCredentialsCredentialIdResponse, error) {
rsp, err := c.DeleteUsersWebauthnCredentialsCredentialId(ctx, id, credentialId, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteUsersWebauthnCredentialsCredentialIdResponse(rsp)
}
// GetUsersWebauthnCredentialsCredentialIdWithResponse request returning *GetUsersWebauthnCredentialsCredentialIdResponse
func (c *ClientWithResponses) GetUsersWebauthnCredentialsCredentialIdWithResponse(ctx context.Context, id Id, credentialId string, reqEditors ...RequestEditorFn) (*GetUsersWebauthnCredentialsCredentialIdResponse, error) {
rsp, err := c.GetUsersWebauthnCredentialsCredentialId(ctx, id, credentialId, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetUsersWebauthnCredentialsCredentialIdResponse(rsp)
}
// ListWebhooksWithResponse request returning *ListWebhooksResponse
func (c *ClientWithResponses) ListWebhooksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListWebhooksResponse, error) {
rsp, err := c.ListWebhooks(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseListWebhooksResponse(rsp)
}
// CreateDbWebhooksWithBodyWithResponse request with arbitrary body returning *CreateDbWebhooksResponse
func (c *ClientWithResponses) CreateDbWebhooksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDbWebhooksResponse, error) {
rsp, err := c.CreateDbWebhooksWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateDbWebhooksResponse(rsp)
}
func (c *ClientWithResponses) CreateDbWebhooksWithResponse(ctx context.Context, body CreateDbWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDbWebhooksResponse, error) {
rsp, err := c.CreateDbWebhooks(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateDbWebhooksResponse(rsp)
}
// DeleteWebhooksIdWithResponse request returning *DeleteWebhooksIdResponse
func (c *ClientWithResponses) DeleteWebhooksIdWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*DeleteWebhooksIdResponse, error) {
rsp, err := c.DeleteWebhooksId(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteWebhooksIdResponse(rsp)
}
// GetWebhooksIdWithResponse request returning *GetWebhooksIdResponse
func (c *ClientWithResponses) GetWebhooksIdWithResponse(ctx context.Context, id Id, reqEditors ...RequestEditorFn) (*GetWebhooksIdResponse, error) {
rsp, err := c.GetWebhooksId(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetWebhooksIdResponse(rsp)
}
// PutWebhooksIdWithBodyWithResponse request with arbitrary body returning *PutWebhooksIdResponse
func (c *ClientWithResponses) PutWebhooksIdWithBodyWithResponse(ctx context.Context, id Id, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutWebhooksIdResponse, error) {
rsp, err := c.PutWebhooksIdWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePutWebhooksIdResponse(rsp)
}
func (c *ClientWithResponses) PutWebhooksIdWithResponse(ctx context.Context, id Id, body PutWebhooksIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutWebhooksIdResponse, error) {
rsp, err := c.PutWebhooksId(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePutWebhooksIdResponse(rsp)
}
// ParseStatusResponse parses an HTTP response from a StatusWithResponse call
func ParseStatusResponse(rsp *http.Response) (*StatusResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &StatusResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
return response, nil
}
// ParseListAuditLogsResponse parses an HTTP response from a ListAuditLogsWithResponse call
func ParseListAuditLogsResponse(rsp *http.Response) (*ListAuditLogsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListAuditLogsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []AuditLog
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetMetricsResponse parses an HTTP response from a GetMetricsWithResponse call
func ParseGetMetricsResponse(rsp *http.Response) (*GetMetricsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetMetricsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
return response, nil
}
// ParsePostSessionsResponse parses an HTTP response from a PostSessionsWithResponse call
func ParsePostSessionsResponse(rsp *http.Response) (*PostSessionsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PostSessionsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest CreateSessionResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseListUsersResponse parses an HTTP response from a ListUsersWithResponse call
func ParseListUsersResponse(rsp *http.Response) (*ListUsersResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListUsersResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []UserBase
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseCreateUserResponse parses an HTTP response from a CreateUserWithResponse call
func ParseCreateUserResponse(rsp *http.Response) (*CreateUserResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CreateUserResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest User
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest Conflict
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteUserResponse parses an HTTP response from a DeleteUserWithResponse call
func ParseDeleteUserResponse(rsp *http.Response) (*DeleteUserResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteUserResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call
func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUserResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest User
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersIdEmailsResponse parses an HTTP response from a GetUsersIdEmailsWithResponse call
func ParseGetUsersIdEmailsResponse(rsp *http.Response) (*GetUsersIdEmailsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersIdEmailsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []Email
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParsePostUsersIdEmailsResponse parses an HTTP response from a PostUsersIdEmailsWithResponse call
func ParsePostUsersIdEmailsResponse(rsp *http.Response) (*PostUsersIdEmailsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PostUsersIdEmailsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
var dest Email
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON201 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest Conflict
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteUsersEmailsEmailIdResponse parses an HTTP response from a DeleteUsersEmailsEmailIdWithResponse call
func ParseDeleteUsersEmailsEmailIdResponse(rsp *http.Response) (*DeleteUsersEmailsEmailIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteUsersEmailsEmailIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest Conflict
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersIdEmailsEmailIdResponse parses an HTTP response from a GetUsersIdEmailsEmailIdWithResponse call
func ParseGetUsersIdEmailsEmailIdResponse(rsp *http.Response) (*GetUsersIdEmailsEmailIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersIdEmailsEmailIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Email
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParsePostUsersEmailsEmailIdSetPrimaryResponse parses an HTTP response from a PostUsersEmailsEmailIdSetPrimaryWithResponse call
func ParsePostUsersEmailsEmailIdSetPrimaryResponse(rsp *http.Response) (*PostUsersEmailsEmailIdSetPrimaryResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PostUsersEmailsEmailIdSetPrimaryResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUserMetadataResponse parses an HTTP response from a GetUserMetadataWithResponse call
func ParseGetUserMetadataResponse(rsp *http.Response) (*GetUserMetadataResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUserMetadataResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest UserMetadata
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParsePatchUserMetadataResponse parses an HTTP response from a PatchUserMetadataWithResponse call
func ParsePatchUserMetadataResponse(rsp *http.Response) (*PatchUserMetadataResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PatchUserMetadataResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest UserMetadata
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteUsersOtpResponse parses an HTTP response from a DeleteUsersOtpWithResponse call
func ParseDeleteUsersOtpResponse(rsp *http.Response) (*DeleteUsersOtpResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteUsersOtpResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersOtpResponse parses an HTTP response from a GetUsersOtpWithResponse call
func ParseGetUsersOtpResponse(rsp *http.Response) (*GetUsersOtpResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersOtpResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest OTP
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteUsersPasswordResponse parses an HTTP response from a DeleteUsersPasswordWithResponse call
func ParseDeleteUsersPasswordResponse(rsp *http.Response) (*DeleteUsersPasswordResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteUsersPasswordResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersPasswordResponse parses an HTTP response from a GetUsersPasswordWithResponse call
func ParseGetUsersPasswordResponse(rsp *http.Response) (*GetUsersPasswordResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersPasswordResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Password
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParsePostUsersPasswordResponse parses an HTTP response from a PostUsersPasswordWithResponse call
func ParsePostUsersPasswordResponse(rsp *http.Response) (*PostUsersPasswordResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PostUsersPasswordResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Password
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParsePutUsersPasswordResponse parses an HTTP response from a PutUsersPasswordWithResponse call
func ParsePutUsersPasswordResponse(rsp *http.Response) (*PutUsersPasswordResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PutUsersPasswordResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Password
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersSessionsResponse parses an HTTP response from a GetUsersSessionsWithResponse call
func ParseGetUsersSessionsResponse(rsp *http.Response) (*GetUsersSessionsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersSessionsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []Session
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteUsersSessionsSessionIdResponse parses an HTTP response from a DeleteUsersSessionsSessionIdWithResponse call
func ParseDeleteUsersSessionsSessionIdResponse(rsp *http.Response) (*DeleteUsersSessionsSessionIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteUsersSessionsSessionIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersWebauthnCredentialsResponse parses an HTTP response from a GetUsersWebauthnCredentialsWithResponse call
func ParseGetUsersWebauthnCredentialsResponse(rsp *http.Response) (*GetUsersWebauthnCredentialsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersWebauthnCredentialsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []WebAuthnCredential
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteUsersWebauthnCredentialsCredentialIdResponse parses an HTTP response from a DeleteUsersWebauthnCredentialsCredentialIdWithResponse call
func ParseDeleteUsersWebauthnCredentialsCredentialIdResponse(rsp *http.Response) (*DeleteUsersWebauthnCredentialsCredentialIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteUsersWebauthnCredentialsCredentialIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseGetUsersWebauthnCredentialsCredentialIdResponse parses an HTTP response from a GetUsersWebauthnCredentialsCredentialIdWithResponse call
func ParseGetUsersWebauthnCredentialsCredentialIdResponse(rsp *http.Response) (*GetUsersWebauthnCredentialsCredentialIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetUsersWebauthnCredentialsCredentialIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest WebAuthnCredential
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseListWebhooksResponse parses an HTTP response from a ListWebhooksWithResponse call
func ParseListWebhooksResponse(rsp *http.Response) (*ListWebhooksResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListWebhooksResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest struct {
Config *[]Webhook `json:"config,omitempty"`
Database *[]DatabaseWebhook `json:"database,omitempty"`
}
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseCreateDbWebhooksResponse parses an HTTP response from a CreateDbWebhooksWithResponse call
func ParseCreateDbWebhooksResponse(rsp *http.Response) (*CreateDbWebhooksResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CreateDbWebhooksResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
var dest DatabaseWebhook
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON201 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParseDeleteWebhooksIdResponse parses an HTTP response from a DeleteWebhooksIdWithResponse call
func ParseDeleteWebhooksIdResponse(rsp *http.Response) (*DeleteWebhooksIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteWebhooksIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseGetWebhooksIdResponse parses an HTTP response from a GetWebhooksIdWithResponse call
func ParseGetWebhooksIdResponse(rsp *http.Response) (*GetWebhooksIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetWebhooksIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest DatabaseWebhook
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}
// ParsePutWebhooksIdResponse parses an HTTP response from a PutWebhooksIdWithResponse call
func ParsePutWebhooksIdResponse(rsp *http.Response) (*PutWebhooksIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PutWebhooksIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest DatabaseWebhook
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest BadRequest
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest NotFound
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
var dest InternalServerError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON500 = &dest
}
return response, nil
}