2675 lines
86 KiB
Go
2675 lines
86 KiB
Go
// Package admin provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
|
|
package admin
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
"net/http"
|
|
"net/url"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/deepmap/oapi-codegen/pkg/runtime"
|
|
openapi_types "github.com/deepmap/oapi-codegen/pkg/types"
|
|
)
|
|
|
|
const (
|
|
APIKeyAuthScopes = "APIKeyAuth.Scopes"
|
|
AdminAuthScopes = "AdminAuth.Scopes"
|
|
)
|
|
|
|
// Defines values for PostAdminSsoProvidersJSONBodyType.
|
|
const (
|
|
Saml PostAdminSsoProvidersJSONBodyType = "saml"
|
|
)
|
|
|
|
// Defines values for PostGenerateLinkJSONBodyType.
|
|
const (
|
|
EmailChangeCurrent PostGenerateLinkJSONBodyType = "email_change_current"
|
|
EmailChangeNew PostGenerateLinkJSONBodyType = "email_change_new"
|
|
Magiclink PostGenerateLinkJSONBodyType = "magiclink"
|
|
Recovery PostGenerateLinkJSONBodyType = "recovery"
|
|
Signup PostGenerateLinkJSONBodyType = "signup"
|
|
)
|
|
|
|
// ErrorSchema defines model for ErrorSchema.
|
|
type ErrorSchema struct {
|
|
// Code The HTTP status code. Usually missing if `error` is present.
|
|
Code *int `json:"code,omitempty"`
|
|
|
|
// Error Certain responses will contain this property with the provided values.
|
|
//
|
|
// Usually one of these:
|
|
// - invalid_request
|
|
// - unauthorized_client
|
|
// - access_denied
|
|
// - server_error
|
|
// - temporarily_unavailable
|
|
// - unsupported_otp_type
|
|
Error *string `json:"error,omitempty"`
|
|
|
|
// ErrorDescription Certain responses that have an `error` property may have this property which describes the error.
|
|
ErrorDescription *string `json:"error_description,omitempty"`
|
|
|
|
// Msg A basic message describing the problem with the request. Usually missing if `error` is present.
|
|
Msg *string `json:"msg,omitempty"`
|
|
}
|
|
|
|
// MFAFactorSchema Represents a MFA factor.
|
|
type MFAFactorSchema struct {
|
|
// FactorType Usually one of:
|
|
// - totp
|
|
FactorType *string `json:"factor_type,omitempty"`
|
|
FriendlyName *string `json:"friendly_name,omitempty"`
|
|
Id *openapi_types.UUID `json:"id,omitempty"`
|
|
|
|
// Status Usually one of:
|
|
// - verified
|
|
// - unverified
|
|
Status *string `json:"status,omitempty"`
|
|
}
|
|
|
|
// SAMLAttributeMappingSchema defines model for SAMLAttributeMappingSchema.
|
|
type SAMLAttributeMappingSchema struct {
|
|
Keys *map[string]interface{} `json:"keys,omitempty"`
|
|
}
|
|
|
|
// SSOProviderSchema defines model for SSOProviderSchema.
|
|
type SSOProviderSchema struct {
|
|
Id *openapi_types.UUID `json:"id,omitempty"`
|
|
Saml *struct {
|
|
AttributeMapping *SAMLAttributeMappingSchema `json:"attribute_mapping,omitempty"`
|
|
EntityId *string `json:"entity_id,omitempty"`
|
|
MetadataUrl *string `json:"metadata_url,omitempty"`
|
|
MetadataXml *string `json:"metadata_xml,omitempty"`
|
|
} `json:"saml,omitempty"`
|
|
SsoDomains *[]struct {
|
|
Domain *string `json:"domain,omitempty"`
|
|
} `json:"sso_domains,omitempty"`
|
|
}
|
|
|
|
// UserSchema Object describing the user related to the issued access and refresh tokens.
|
|
type UserSchema struct {
|
|
AppMetadata *map[string]interface{} `json:"app_metadata,omitempty"`
|
|
Aud *string `json:"aud,omitempty"`
|
|
BannedUntil *time.Time `json:"banned_until,omitempty"`
|
|
ConfirmationSentAt *time.Time `json:"confirmation_sent_at,omitempty"`
|
|
ConfirmedAt *time.Time `json:"confirmed_at,omitempty"`
|
|
CreatedAt *time.Time `json:"created_at,omitempty"`
|
|
DeletedAt *time.Time `json:"deleted_at,omitempty"`
|
|
|
|
// Email User's primary contact email. In most cases you can uniquely identify a user by their email address, but not in all cases.
|
|
Email *string `json:"email,omitempty"`
|
|
EmailChangeSentAt *time.Time `json:"email_change_sent_at,omitempty"`
|
|
EmailConfirmedAt *time.Time `json:"email_confirmed_at,omitempty"`
|
|
Factors *[]MFAFactorSchema `json:"factors,omitempty"`
|
|
Id *openapi_types.UUID `json:"id,omitempty"`
|
|
Identities *[]map[string]interface{} `json:"identities,omitempty"`
|
|
LastSignInAt *time.Time `json:"last_sign_in_at,omitempty"`
|
|
NewEmail *openapi_types.Email `json:"new_email,omitempty"`
|
|
NewPhone *string `json:"new_phone,omitempty"`
|
|
|
|
// Phone User's primary contact phone number. In most cases you can uniquely identify a user by their phone number, but not in all cases.
|
|
Phone *string `json:"phone,omitempty"`
|
|
PhoneChangeSentAt *time.Time `json:"phone_change_sent_at,omitempty"`
|
|
PhoneConfirmedAt *time.Time `json:"phone_confirmed_at,omitempty"`
|
|
ReauthenticationSentAt *time.Time `json:"reauthentication_sent_at,omitempty"`
|
|
RecoverySentAt *time.Time `json:"recovery_sent_at,omitempty"`
|
|
Role *string `json:"role,omitempty"`
|
|
UpdatedAt *time.Time `json:"updated_at,omitempty"`
|
|
UserMetadata *map[string]interface{} `json:"user_metadata,omitempty"`
|
|
}
|
|
|
|
// BadRequestResponse defines model for BadRequestResponse.
|
|
type BadRequestResponse = ErrorSchema
|
|
|
|
// ForbiddenResponse defines model for ForbiddenResponse.
|
|
type ForbiddenResponse = ErrorSchema
|
|
|
|
// UnauthorizedResponse defines model for UnauthorizedResponse.
|
|
type UnauthorizedResponse = ErrorSchema
|
|
|
|
// GetAdminAuditParams defines parameters for GetAdminAudit.
|
|
type GetAdminAuditParams struct {
|
|
Page *int `form:"page,omitempty" json:"page,omitempty"`
|
|
PerPage *int `form:"per_page,omitempty" json:"per_page,omitempty"`
|
|
}
|
|
|
|
// PostAdminSsoProvidersJSONBody defines parameters for PostAdminSsoProviders.
|
|
type PostAdminSsoProvidersJSONBody struct {
|
|
AttributeMapping *SAMLAttributeMappingSchema `json:"attribute_mapping,omitempty"`
|
|
Domains *[]string `json:"domains,omitempty"`
|
|
MetadataUrl *string `json:"metadata_url,omitempty"`
|
|
MetadataXml *string `json:"metadata_xml,omitempty"`
|
|
Type PostAdminSsoProvidersJSONBodyType `json:"type"`
|
|
}
|
|
|
|
// PostAdminSsoProvidersJSONBodyType defines parameters for PostAdminSsoProviders.
|
|
type PostAdminSsoProvidersJSONBodyType string
|
|
|
|
// PutAdminSsoProvidersSsoProviderIdJSONBody defines parameters for PutAdminSsoProvidersSsoProviderId.
|
|
type PutAdminSsoProvidersSsoProviderIdJSONBody struct {
|
|
AttributeMapping *SAMLAttributeMappingSchema `json:"attribute_mapping,omitempty"`
|
|
Domains *[]string `json:"domains,omitempty"`
|
|
MetadataUrl *string `json:"metadata_url,omitempty"`
|
|
MetadataXml *string `json:"metadata_xml,omitempty"`
|
|
}
|
|
|
|
// GetAdminUsersParams defines parameters for GetAdminUsers.
|
|
type GetAdminUsersParams struct {
|
|
Page *int `form:"page,omitempty" json:"page,omitempty"`
|
|
PerPage *int `form:"per_page,omitempty" json:"per_page,omitempty"`
|
|
}
|
|
|
|
// PutAdminUsersUserIdFactorsFactorIdJSONBody defines parameters for PutAdminUsersUserIdFactorsFactorId.
|
|
type PutAdminUsersUserIdFactorsFactorIdJSONBody = map[string]interface{}
|
|
|
|
// PostGenerateLinkJSONBody defines parameters for PostGenerateLink.
|
|
type PostGenerateLinkJSONBody struct {
|
|
Data *map[string]interface{} `json:"data,omitempty"`
|
|
Email openapi_types.Email `json:"email"`
|
|
NewEmail *openapi_types.Email `json:"new_email,omitempty"`
|
|
Password *string `json:"password,omitempty"`
|
|
RedirectTo *string `json:"redirect_to,omitempty"`
|
|
Type PostGenerateLinkJSONBodyType `json:"type"`
|
|
}
|
|
|
|
// PostGenerateLinkJSONBodyType defines parameters for PostGenerateLink.
|
|
type PostGenerateLinkJSONBodyType string
|
|
|
|
// PostInviteJSONBody defines parameters for PostInvite.
|
|
type PostInviteJSONBody struct {
|
|
Data *map[string]interface{} `json:"data,omitempty"`
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
// PostAdminSsoProvidersJSONRequestBody defines body for PostAdminSsoProviders for application/json ContentType.
|
|
type PostAdminSsoProvidersJSONRequestBody PostAdminSsoProvidersJSONBody
|
|
|
|
// PutAdminSsoProvidersSsoProviderIdJSONRequestBody defines body for PutAdminSsoProvidersSsoProviderId for application/json ContentType.
|
|
type PutAdminSsoProvidersSsoProviderIdJSONRequestBody PutAdminSsoProvidersSsoProviderIdJSONBody
|
|
|
|
// PutAdminUsersUserIdJSONRequestBody defines body for PutAdminUsersUserId for application/json ContentType.
|
|
type PutAdminUsersUserIdJSONRequestBody = UserSchema
|
|
|
|
// PutAdminUsersUserIdFactorsFactorIdJSONRequestBody defines body for PutAdminUsersUserIdFactorsFactorId for application/json ContentType.
|
|
type PutAdminUsersUserIdFactorsFactorIdJSONRequestBody = PutAdminUsersUserIdFactorsFactorIdJSONBody
|
|
|
|
// PostGenerateLinkJSONRequestBody defines body for PostGenerateLink for application/json ContentType.
|
|
type PostGenerateLinkJSONRequestBody PostGenerateLinkJSONBody
|
|
|
|
// PostInviteJSONRequestBody defines body for PostInvite for application/json ContentType.
|
|
type PostInviteJSONRequestBody PostInviteJSONBody
|
|
|
|
// 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 {
|
|
// GetAdminAudit request
|
|
GetAdminAudit(ctx context.Context, params *GetAdminAuditParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetAdminSsoProviders request
|
|
GetAdminSsoProviders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PostAdminSsoProviders request with any body
|
|
PostAdminSsoProvidersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
PostAdminSsoProviders(ctx context.Context, body PostAdminSsoProvidersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// DeleteAdminSsoProvidersSsoProviderId request
|
|
DeleteAdminSsoProvidersSsoProviderId(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetAdminSsoProvidersSsoProviderId request
|
|
GetAdminSsoProvidersSsoProviderId(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PutAdminSsoProvidersSsoProviderId request with any body
|
|
PutAdminSsoProvidersSsoProviderIdWithBody(ctx context.Context, ssoProviderId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
PutAdminSsoProvidersSsoProviderId(ctx context.Context, ssoProviderId openapi_types.UUID, body PutAdminSsoProvidersSsoProviderIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetAdminUsers request
|
|
GetAdminUsers(ctx context.Context, params *GetAdminUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// DeleteAdminUsersUserId request
|
|
DeleteAdminUsersUserId(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetAdminUsersUserId request
|
|
GetAdminUsersUserId(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PutAdminUsersUserId request with any body
|
|
PutAdminUsersUserIdWithBody(ctx context.Context, userId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
PutAdminUsersUserId(ctx context.Context, userId openapi_types.UUID, body PutAdminUsersUserIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetAdminUsersUserIdFactors request
|
|
GetAdminUsersUserIdFactors(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// DeleteAdminUsersUserIdFactorsFactorId request
|
|
DeleteAdminUsersUserIdFactorsFactorId(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PutAdminUsersUserIdFactorsFactorId request with any body
|
|
PutAdminUsersUserIdFactorsFactorIdWithBody(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
PutAdminUsersUserIdFactorsFactorId(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, body PutAdminUsersUserIdFactorsFactorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PostGenerateLink request with any body
|
|
PostGenerateLinkWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
PostGenerateLink(ctx context.Context, body PostGenerateLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PostInvite request with any body
|
|
PostInviteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
PostInvite(ctx context.Context, body PostInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
}
|
|
|
|
func (c *Client) GetAdminAudit(ctx context.Context, params *GetAdminAuditParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAdminAuditRequest(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) GetAdminSsoProviders(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAdminSsoProvidersRequest(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) PostAdminSsoProvidersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostAdminSsoProvidersRequestWithBody(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) PostAdminSsoProviders(ctx context.Context, body PostAdminSsoProvidersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostAdminSsoProvidersRequest(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) DeleteAdminSsoProvidersSsoProviderId(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteAdminSsoProvidersSsoProviderIdRequest(c.Server, ssoProviderId)
|
|
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) GetAdminSsoProvidersSsoProviderId(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAdminSsoProvidersSsoProviderIdRequest(c.Server, ssoProviderId)
|
|
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) PutAdminSsoProvidersSsoProviderIdWithBody(ctx context.Context, ssoProviderId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPutAdminSsoProvidersSsoProviderIdRequestWithBody(c.Server, ssoProviderId, 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) PutAdminSsoProvidersSsoProviderId(ctx context.Context, ssoProviderId openapi_types.UUID, body PutAdminSsoProvidersSsoProviderIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPutAdminSsoProvidersSsoProviderIdRequest(c.Server, ssoProviderId, 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) GetAdminUsers(ctx context.Context, params *GetAdminUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAdminUsersRequest(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) DeleteAdminUsersUserId(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteAdminUsersUserIdRequest(c.Server, userId)
|
|
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) GetAdminUsersUserId(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAdminUsersUserIdRequest(c.Server, userId)
|
|
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) PutAdminUsersUserIdWithBody(ctx context.Context, userId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPutAdminUsersUserIdRequestWithBody(c.Server, userId, 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) PutAdminUsersUserId(ctx context.Context, userId openapi_types.UUID, body PutAdminUsersUserIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPutAdminUsersUserIdRequest(c.Server, userId, 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) GetAdminUsersUserIdFactors(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAdminUsersUserIdFactorsRequest(c.Server, userId)
|
|
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) DeleteAdminUsersUserIdFactorsFactorId(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteAdminUsersUserIdFactorsFactorIdRequest(c.Server, userId, factorId)
|
|
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) PutAdminUsersUserIdFactorsFactorIdWithBody(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPutAdminUsersUserIdFactorsFactorIdRequestWithBody(c.Server, userId, factorId, 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) PutAdminUsersUserIdFactorsFactorId(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, body PutAdminUsersUserIdFactorsFactorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPutAdminUsersUserIdFactorsFactorIdRequest(c.Server, userId, factorId, 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) PostGenerateLinkWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostGenerateLinkRequestWithBody(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) PostGenerateLink(ctx context.Context, body PostGenerateLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostGenerateLinkRequest(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) PostInviteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostInviteRequestWithBody(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) PostInvite(ctx context.Context, body PostInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostInviteRequest(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)
|
|
}
|
|
|
|
// NewGetAdminAuditRequest generates requests for GetAdminAudit
|
|
func NewGetAdminAuditRequest(server string, params *GetAdminAuditParams) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/audit")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
queryURL.RawQuery = queryValues.Encode()
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetAdminSsoProvidersRequest generates requests for GetAdminSsoProviders
|
|
func NewGetAdminSsoProvidersRequest(server string) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/sso/providers")
|
|
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
|
|
}
|
|
|
|
// NewPostAdminSsoProvidersRequest calls the generic PostAdminSsoProviders builder with application/json body
|
|
func NewPostAdminSsoProvidersRequest(server string, body PostAdminSsoProvidersJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewPostAdminSsoProvidersRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewPostAdminSsoProvidersRequestWithBody generates requests for PostAdminSsoProviders with any type of body
|
|
func NewPostAdminSsoProvidersRequestWithBody(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("/admin/sso/providers")
|
|
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
|
|
}
|
|
|
|
// NewDeleteAdminSsoProvidersSsoProviderIdRequest generates requests for DeleteAdminSsoProvidersSsoProviderId
|
|
func NewDeleteAdminSsoProvidersSsoProviderIdRequest(server string, ssoProviderId openapi_types.UUID) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ssoProviderId", runtime.ParamLocationPath, ssoProviderId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/sso/providers/%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
|
|
}
|
|
|
|
// NewGetAdminSsoProvidersSsoProviderIdRequest generates requests for GetAdminSsoProvidersSsoProviderId
|
|
func NewGetAdminSsoProvidersSsoProviderIdRequest(server string, ssoProviderId openapi_types.UUID) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ssoProviderId", runtime.ParamLocationPath, ssoProviderId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/sso/providers/%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
|
|
}
|
|
|
|
// NewPutAdminSsoProvidersSsoProviderIdRequest calls the generic PutAdminSsoProvidersSsoProviderId builder with application/json body
|
|
func NewPutAdminSsoProvidersSsoProviderIdRequest(server string, ssoProviderId openapi_types.UUID, body PutAdminSsoProvidersSsoProviderIdJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewPutAdminSsoProvidersSsoProviderIdRequestWithBody(server, ssoProviderId, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewPutAdminSsoProvidersSsoProviderIdRequestWithBody generates requests for PutAdminSsoProvidersSsoProviderId with any type of body
|
|
func NewPutAdminSsoProvidersSsoProviderIdRequestWithBody(server string, ssoProviderId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "ssoProviderId", runtime.ParamLocationPath, ssoProviderId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/sso/providers/%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
|
|
}
|
|
|
|
// NewGetAdminUsersRequest generates requests for GetAdminUsers
|
|
func NewGetAdminUsersRequest(server string, params *GetAdminUsersParams) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/users")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
queryURL.RawQuery = queryValues.Encode()
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewDeleteAdminUsersUserIdRequest generates requests for DeleteAdminUsersUserId
|
|
func NewDeleteAdminUsersUserIdRequest(server string, userId openapi_types.UUID) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/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
|
|
}
|
|
|
|
// NewGetAdminUsersUserIdRequest generates requests for GetAdminUsersUserId
|
|
func NewGetAdminUsersUserIdRequest(server string, userId openapi_types.UUID) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/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
|
|
}
|
|
|
|
// NewPutAdminUsersUserIdRequest calls the generic PutAdminUsersUserId builder with application/json body
|
|
func NewPutAdminUsersUserIdRequest(server string, userId openapi_types.UUID, body PutAdminUsersUserIdJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewPutAdminUsersUserIdRequestWithBody(server, userId, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewPutAdminUsersUserIdRequestWithBody generates requests for PutAdminUsersUserId with any type of body
|
|
func NewPutAdminUsersUserIdRequestWithBody(server string, userId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/users/%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
|
|
}
|
|
|
|
// NewGetAdminUsersUserIdFactorsRequest generates requests for GetAdminUsersUserIdFactors
|
|
func NewGetAdminUsersUserIdFactorsRequest(server string, userId openapi_types.UUID) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/users/%s/factors", 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
|
|
}
|
|
|
|
// NewDeleteAdminUsersUserIdFactorsFactorIdRequest generates requests for DeleteAdminUsersUserIdFactorsFactorId
|
|
func NewDeleteAdminUsersUserIdFactorsFactorIdRequest(server string, userId openapi_types.UUID, factorId openapi_types.UUID) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "factorId", runtime.ParamLocationPath, factorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/users/%s/factors/%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
|
|
}
|
|
|
|
// NewPutAdminUsersUserIdFactorsFactorIdRequest calls the generic PutAdminUsersUserIdFactorsFactorId builder with application/json body
|
|
func NewPutAdminUsersUserIdFactorsFactorIdRequest(server string, userId openapi_types.UUID, factorId openapi_types.UUID, body PutAdminUsersUserIdFactorsFactorIdJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewPutAdminUsersUserIdFactorsFactorIdRequestWithBody(server, userId, factorId, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewPutAdminUsersUserIdFactorsFactorIdRequestWithBody generates requests for PutAdminUsersUserIdFactorsFactorId with any type of body
|
|
func NewPutAdminUsersUserIdFactorsFactorIdRequestWithBody(server string, userId openapi_types.UUID, factorId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "factorId", runtime.ParamLocationPath, factorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/admin/users/%s/factors/%s", pathParam0, pathParam1)
|
|
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
|
|
}
|
|
|
|
// NewPostGenerateLinkRequest calls the generic PostGenerateLink builder with application/json body
|
|
func NewPostGenerateLinkRequest(server string, body PostGenerateLinkJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewPostGenerateLinkRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewPostGenerateLinkRequestWithBody generates requests for PostGenerateLink with any type of body
|
|
func NewPostGenerateLinkRequestWithBody(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("/generate_link")
|
|
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
|
|
}
|
|
|
|
// NewPostInviteRequest calls the generic PostInvite builder with application/json body
|
|
func NewPostInviteRequest(server string, body PostInviteJSONRequestBody) (*http.Request, error) {
|
|
var bodyReader io.Reader
|
|
buf, err := json.Marshal(body)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
bodyReader = bytes.NewReader(buf)
|
|
return NewPostInviteRequestWithBody(server, "application/json", bodyReader)
|
|
}
|
|
|
|
// NewPostInviteRequestWithBody generates requests for PostInvite with any type of body
|
|
func NewPostInviteRequestWithBody(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("/invite")
|
|
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
|
|
}
|
|
|
|
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 {
|
|
// GetAdminAudit request
|
|
GetAdminAuditWithResponse(ctx context.Context, params *GetAdminAuditParams, reqEditors ...RequestEditorFn) (*GetAdminAuditResponse, error)
|
|
|
|
// GetAdminSsoProviders request
|
|
GetAdminSsoProvidersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAdminSsoProvidersResponse, error)
|
|
|
|
// PostAdminSsoProviders request with any body
|
|
PostAdminSsoProvidersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAdminSsoProvidersResponse, error)
|
|
|
|
PostAdminSsoProvidersWithResponse(ctx context.Context, body PostAdminSsoProvidersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAdminSsoProvidersResponse, error)
|
|
|
|
// DeleteAdminSsoProvidersSsoProviderId request
|
|
DeleteAdminSsoProvidersSsoProviderIdWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAdminSsoProvidersSsoProviderIdResponse, error)
|
|
|
|
// GetAdminSsoProvidersSsoProviderId request
|
|
GetAdminSsoProvidersSsoProviderIdWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAdminSsoProvidersSsoProviderIdResponse, error)
|
|
|
|
// PutAdminSsoProvidersSsoProviderId request with any body
|
|
PutAdminSsoProvidersSsoProviderIdWithBodyWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAdminSsoProvidersSsoProviderIdResponse, error)
|
|
|
|
PutAdminSsoProvidersSsoProviderIdWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, body PutAdminSsoProvidersSsoProviderIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAdminSsoProvidersSsoProviderIdResponse, error)
|
|
|
|
// GetAdminUsers request
|
|
GetAdminUsersWithResponse(ctx context.Context, params *GetAdminUsersParams, reqEditors ...RequestEditorFn) (*GetAdminUsersResponse, error)
|
|
|
|
// DeleteAdminUsersUserId request
|
|
DeleteAdminUsersUserIdWithResponse(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAdminUsersUserIdResponse, error)
|
|
|
|
// GetAdminUsersUserId request
|
|
GetAdminUsersUserIdWithResponse(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAdminUsersUserIdResponse, error)
|
|
|
|
// PutAdminUsersUserId request with any body
|
|
PutAdminUsersUserIdWithBodyWithResponse(ctx context.Context, userId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdResponse, error)
|
|
|
|
PutAdminUsersUserIdWithResponse(ctx context.Context, userId openapi_types.UUID, body PutAdminUsersUserIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdResponse, error)
|
|
|
|
// GetAdminUsersUserIdFactors request
|
|
GetAdminUsersUserIdFactorsWithResponse(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAdminUsersUserIdFactorsResponse, error)
|
|
|
|
// DeleteAdminUsersUserIdFactorsFactorId request
|
|
DeleteAdminUsersUserIdFactorsFactorIdWithResponse(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAdminUsersUserIdFactorsFactorIdResponse, error)
|
|
|
|
// PutAdminUsersUserIdFactorsFactorId request with any body
|
|
PutAdminUsersUserIdFactorsFactorIdWithBodyWithResponse(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdFactorsFactorIdResponse, error)
|
|
|
|
PutAdminUsersUserIdFactorsFactorIdWithResponse(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, body PutAdminUsersUserIdFactorsFactorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdFactorsFactorIdResponse, error)
|
|
|
|
// PostGenerateLink request with any body
|
|
PostGenerateLinkWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostGenerateLinkResponse, error)
|
|
|
|
PostGenerateLinkWithResponse(ctx context.Context, body PostGenerateLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*PostGenerateLinkResponse, error)
|
|
|
|
// PostInvite request with any body
|
|
PostInviteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInviteResponse, error)
|
|
|
|
PostInviteWithResponse(ctx context.Context, body PostInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInviteResponse, error)
|
|
}
|
|
|
|
type GetAdminAuditResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
CreatedAt *time.Time `json:"created_at,omitempty"`
|
|
Id *openapi_types.UUID `json:"id,omitempty"`
|
|
IpAddress *string `json:"ip_address,omitempty"`
|
|
Payload *struct {
|
|
// Action Usually one of these values:
|
|
// - login
|
|
// - logout
|
|
// - invite_accepted
|
|
// - user_signedup
|
|
// - user_invited
|
|
// - user_deleted
|
|
// - user_modified
|
|
// - user_recovery_requested
|
|
// - user_reauthenticate_requested
|
|
// - user_confirmation_requested
|
|
// - user_repeated_signup
|
|
// - user_updated_password
|
|
// - token_revoked
|
|
// - token_refreshed
|
|
// - generate_recovery_codes
|
|
// - factor_in_progress
|
|
// - factor_unenrolled
|
|
// - challenge_created
|
|
// - verification_attempted
|
|
// - factor_deleted
|
|
// - recovery_codes_deleted
|
|
// - factor_updated
|
|
// - mfa_code_login
|
|
Action *string `json:"action,omitempty"`
|
|
ActorId *string `json:"actor_id,omitempty"`
|
|
ActorName *string `json:"actor_name,omitempty"`
|
|
ActorUsername *string `json:"actor_username,omitempty"`
|
|
|
|
// LogType Usually one of these values:
|
|
// - account
|
|
// - team
|
|
// - token
|
|
// - user
|
|
// - factor
|
|
// - recovery_codes
|
|
LogType *string `json:"log_type,omitempty"`
|
|
Traits *map[string]interface{} `json:"traits,omitempty"`
|
|
} `json:"payload,omitempty"`
|
|
}
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAdminAuditResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAdminAuditResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetAdminSsoProvidersResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Items *[]SSOProviderSchema `json:"items,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAdminSsoProvidersResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAdminSsoProvidersResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PostAdminSsoProvidersResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *SSOProviderSchema
|
|
JSON400 *ErrorSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PostAdminSsoProvidersResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PostAdminSsoProvidersResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type DeleteAdminSsoProvidersSsoProviderIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *SSOProviderSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r DeleteAdminSsoProvidersSsoProviderIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r DeleteAdminSsoProvidersSsoProviderIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetAdminSsoProvidersSsoProviderIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *SSOProviderSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAdminSsoProvidersSsoProviderIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAdminSsoProvidersSsoProviderIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PutAdminSsoProvidersSsoProviderIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *SSOProviderSchema
|
|
JSON400 *ErrorSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PutAdminSsoProvidersSsoProviderIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PutAdminSsoProvidersSsoProviderIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetAdminUsersResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Aud *string `json:"aud,omitempty"`
|
|
Users *[]UserSchema `json:"users,omitempty"`
|
|
}
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAdminUsersResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAdminUsersResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type DeleteAdminUsersUserIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *UserSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r DeleteAdminUsersUserIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r DeleteAdminUsersUserIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetAdminUsersUserIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *UserSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAdminUsersUserIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAdminUsersUserIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PutAdminUsersUserIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *UserSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PutAdminUsersUserIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PutAdminUsersUserIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetAdminUsersUserIdFactorsResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]MFAFactorSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAdminUsersUserIdFactorsResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAdminUsersUserIdFactorsResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type DeleteAdminUsersUserIdFactorsFactorIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *MFAFactorSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r DeleteAdminUsersUserIdFactorsFactorIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r DeleteAdminUsersUserIdFactorsFactorIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PutAdminUsersUserIdFactorsFactorIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *MFAFactorSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PutAdminUsersUserIdFactorsFactorIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PutAdminUsersUserIdFactorsFactorIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PostGenerateLinkResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
ActionLink *string `json:"action_link,omitempty"`
|
|
EmailOtp *string `json:"email_otp,omitempty"`
|
|
HashedToken *string `json:"hashed_token,omitempty"`
|
|
RedirectTo *string `json:"redirect_to,omitempty"`
|
|
VerificationType *string `json:"verification_type,omitempty"`
|
|
AdditionalProperties map[string]interface{} `json:"-"`
|
|
}
|
|
JSON400 *ErrorSchema
|
|
JSON401 *ErrorSchema
|
|
JSON403 *ErrorSchema
|
|
JSON404 *ErrorSchema
|
|
JSON422 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PostGenerateLinkResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PostGenerateLinkResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PostInviteResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *UserSchema
|
|
JSON400 *ErrorSchema
|
|
JSON422 *ErrorSchema
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PostInviteResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PostInviteResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// GetAdminAuditWithResponse request returning *GetAdminAuditResponse
|
|
func (c *ClientWithResponses) GetAdminAuditWithResponse(ctx context.Context, params *GetAdminAuditParams, reqEditors ...RequestEditorFn) (*GetAdminAuditResponse, error) {
|
|
rsp, err := c.GetAdminAudit(ctx, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAdminAuditResponse(rsp)
|
|
}
|
|
|
|
// GetAdminSsoProvidersWithResponse request returning *GetAdminSsoProvidersResponse
|
|
func (c *ClientWithResponses) GetAdminSsoProvidersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAdminSsoProvidersResponse, error) {
|
|
rsp, err := c.GetAdminSsoProviders(ctx, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAdminSsoProvidersResponse(rsp)
|
|
}
|
|
|
|
// PostAdminSsoProvidersWithBodyWithResponse request with arbitrary body returning *PostAdminSsoProvidersResponse
|
|
func (c *ClientWithResponses) PostAdminSsoProvidersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAdminSsoProvidersResponse, error) {
|
|
rsp, err := c.PostAdminSsoProvidersWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostAdminSsoProvidersResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) PostAdminSsoProvidersWithResponse(ctx context.Context, body PostAdminSsoProvidersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAdminSsoProvidersResponse, error) {
|
|
rsp, err := c.PostAdminSsoProviders(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostAdminSsoProvidersResponse(rsp)
|
|
}
|
|
|
|
// DeleteAdminSsoProvidersSsoProviderIdWithResponse request returning *DeleteAdminSsoProvidersSsoProviderIdResponse
|
|
func (c *ClientWithResponses) DeleteAdminSsoProvidersSsoProviderIdWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
rsp, err := c.DeleteAdminSsoProvidersSsoProviderId(ctx, ssoProviderId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteAdminSsoProvidersSsoProviderIdResponse(rsp)
|
|
}
|
|
|
|
// GetAdminSsoProvidersSsoProviderIdWithResponse request returning *GetAdminSsoProvidersSsoProviderIdResponse
|
|
func (c *ClientWithResponses) GetAdminSsoProvidersSsoProviderIdWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
rsp, err := c.GetAdminSsoProvidersSsoProviderId(ctx, ssoProviderId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAdminSsoProvidersSsoProviderIdResponse(rsp)
|
|
}
|
|
|
|
// PutAdminSsoProvidersSsoProviderIdWithBodyWithResponse request with arbitrary body returning *PutAdminSsoProvidersSsoProviderIdResponse
|
|
func (c *ClientWithResponses) PutAdminSsoProvidersSsoProviderIdWithBodyWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
rsp, err := c.PutAdminSsoProvidersSsoProviderIdWithBody(ctx, ssoProviderId, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePutAdminSsoProvidersSsoProviderIdResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) PutAdminSsoProvidersSsoProviderIdWithResponse(ctx context.Context, ssoProviderId openapi_types.UUID, body PutAdminSsoProvidersSsoProviderIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
rsp, err := c.PutAdminSsoProvidersSsoProviderId(ctx, ssoProviderId, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePutAdminSsoProvidersSsoProviderIdResponse(rsp)
|
|
}
|
|
|
|
// GetAdminUsersWithResponse request returning *GetAdminUsersResponse
|
|
func (c *ClientWithResponses) GetAdminUsersWithResponse(ctx context.Context, params *GetAdminUsersParams, reqEditors ...RequestEditorFn) (*GetAdminUsersResponse, error) {
|
|
rsp, err := c.GetAdminUsers(ctx, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAdminUsersResponse(rsp)
|
|
}
|
|
|
|
// DeleteAdminUsersUserIdWithResponse request returning *DeleteAdminUsersUserIdResponse
|
|
func (c *ClientWithResponses) DeleteAdminUsersUserIdWithResponse(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAdminUsersUserIdResponse, error) {
|
|
rsp, err := c.DeleteAdminUsersUserId(ctx, userId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteAdminUsersUserIdResponse(rsp)
|
|
}
|
|
|
|
// GetAdminUsersUserIdWithResponse request returning *GetAdminUsersUserIdResponse
|
|
func (c *ClientWithResponses) GetAdminUsersUserIdWithResponse(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAdminUsersUserIdResponse, error) {
|
|
rsp, err := c.GetAdminUsersUserId(ctx, userId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAdminUsersUserIdResponse(rsp)
|
|
}
|
|
|
|
// PutAdminUsersUserIdWithBodyWithResponse request with arbitrary body returning *PutAdminUsersUserIdResponse
|
|
func (c *ClientWithResponses) PutAdminUsersUserIdWithBodyWithResponse(ctx context.Context, userId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdResponse, error) {
|
|
rsp, err := c.PutAdminUsersUserIdWithBody(ctx, userId, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePutAdminUsersUserIdResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) PutAdminUsersUserIdWithResponse(ctx context.Context, userId openapi_types.UUID, body PutAdminUsersUserIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdResponse, error) {
|
|
rsp, err := c.PutAdminUsersUserId(ctx, userId, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePutAdminUsersUserIdResponse(rsp)
|
|
}
|
|
|
|
// GetAdminUsersUserIdFactorsWithResponse request returning *GetAdminUsersUserIdFactorsResponse
|
|
func (c *ClientWithResponses) GetAdminUsersUserIdFactorsWithResponse(ctx context.Context, userId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAdminUsersUserIdFactorsResponse, error) {
|
|
rsp, err := c.GetAdminUsersUserIdFactors(ctx, userId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAdminUsersUserIdFactorsResponse(rsp)
|
|
}
|
|
|
|
// DeleteAdminUsersUserIdFactorsFactorIdWithResponse request returning *DeleteAdminUsersUserIdFactorsFactorIdResponse
|
|
func (c *ClientWithResponses) DeleteAdminUsersUserIdFactorsFactorIdWithResponse(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAdminUsersUserIdFactorsFactorIdResponse, error) {
|
|
rsp, err := c.DeleteAdminUsersUserIdFactorsFactorId(ctx, userId, factorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteAdminUsersUserIdFactorsFactorIdResponse(rsp)
|
|
}
|
|
|
|
// PutAdminUsersUserIdFactorsFactorIdWithBodyWithResponse request with arbitrary body returning *PutAdminUsersUserIdFactorsFactorIdResponse
|
|
func (c *ClientWithResponses) PutAdminUsersUserIdFactorsFactorIdWithBodyWithResponse(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdFactorsFactorIdResponse, error) {
|
|
rsp, err := c.PutAdminUsersUserIdFactorsFactorIdWithBody(ctx, userId, factorId, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePutAdminUsersUserIdFactorsFactorIdResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) PutAdminUsersUserIdFactorsFactorIdWithResponse(ctx context.Context, userId openapi_types.UUID, factorId openapi_types.UUID, body PutAdminUsersUserIdFactorsFactorIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutAdminUsersUserIdFactorsFactorIdResponse, error) {
|
|
rsp, err := c.PutAdminUsersUserIdFactorsFactorId(ctx, userId, factorId, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePutAdminUsersUserIdFactorsFactorIdResponse(rsp)
|
|
}
|
|
|
|
// PostGenerateLinkWithBodyWithResponse request with arbitrary body returning *PostGenerateLinkResponse
|
|
func (c *ClientWithResponses) PostGenerateLinkWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostGenerateLinkResponse, error) {
|
|
rsp, err := c.PostGenerateLinkWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostGenerateLinkResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) PostGenerateLinkWithResponse(ctx context.Context, body PostGenerateLinkJSONRequestBody, reqEditors ...RequestEditorFn) (*PostGenerateLinkResponse, error) {
|
|
rsp, err := c.PostGenerateLink(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostGenerateLinkResponse(rsp)
|
|
}
|
|
|
|
// PostInviteWithBodyWithResponse request with arbitrary body returning *PostInviteResponse
|
|
func (c *ClientWithResponses) PostInviteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInviteResponse, error) {
|
|
rsp, err := c.PostInviteWithBody(ctx, contentType, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostInviteResponse(rsp)
|
|
}
|
|
|
|
func (c *ClientWithResponses) PostInviteWithResponse(ctx context.Context, body PostInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInviteResponse, error) {
|
|
rsp, err := c.PostInvite(ctx, body, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostInviteResponse(rsp)
|
|
}
|
|
|
|
// ParseGetAdminAuditResponse parses an HTTP response from a GetAdminAuditWithResponse call
|
|
func ParseGetAdminAuditResponse(rsp *http.Response) (*GetAdminAuditResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAdminAuditResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
CreatedAt *time.Time `json:"created_at,omitempty"`
|
|
Id *openapi_types.UUID `json:"id,omitempty"`
|
|
IpAddress *string `json:"ip_address,omitempty"`
|
|
Payload *struct {
|
|
// Action Usually one of these values:
|
|
// - login
|
|
// - logout
|
|
// - invite_accepted
|
|
// - user_signedup
|
|
// - user_invited
|
|
// - user_deleted
|
|
// - user_modified
|
|
// - user_recovery_requested
|
|
// - user_reauthenticate_requested
|
|
// - user_confirmation_requested
|
|
// - user_repeated_signup
|
|
// - user_updated_password
|
|
// - token_revoked
|
|
// - token_refreshed
|
|
// - generate_recovery_codes
|
|
// - factor_in_progress
|
|
// - factor_unenrolled
|
|
// - challenge_created
|
|
// - verification_attempted
|
|
// - factor_deleted
|
|
// - recovery_codes_deleted
|
|
// - factor_updated
|
|
// - mfa_code_login
|
|
Action *string `json:"action,omitempty"`
|
|
ActorId *string `json:"actor_id,omitempty"`
|
|
ActorName *string `json:"actor_name,omitempty"`
|
|
ActorUsername *string `json:"actor_username,omitempty"`
|
|
|
|
// LogType Usually one of these values:
|
|
// - account
|
|
// - team
|
|
// - token
|
|
// - user
|
|
// - factor
|
|
// - recovery_codes
|
|
LogType *string `json:"log_type,omitempty"`
|
|
Traits *map[string]interface{} `json:"traits,omitempty"`
|
|
} `json:"payload,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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetAdminSsoProvidersResponse parses an HTTP response from a GetAdminSsoProvidersWithResponse call
|
|
func ParseGetAdminSsoProvidersResponse(rsp *http.Response) (*GetAdminSsoProvidersResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAdminSsoProvidersResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Items *[]SSOProviderSchema `json:"items,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePostAdminSsoProvidersResponse parses an HTTP response from a PostAdminSsoProvidersWithResponse call
|
|
func ParsePostAdminSsoProvidersResponse(rsp *http.Response) (*PostAdminSsoProvidersResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PostAdminSsoProvidersResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest SSOProviderSchema
|
|
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 ErrorSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseDeleteAdminSsoProvidersSsoProviderIdResponse parses an HTTP response from a DeleteAdminSsoProvidersSsoProviderIdWithResponse call
|
|
func ParseDeleteAdminSsoProvidersSsoProviderIdResponse(rsp *http.Response) (*DeleteAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &DeleteAdminSsoProvidersSsoProviderIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest SSOProviderSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetAdminSsoProvidersSsoProviderIdResponse parses an HTTP response from a GetAdminSsoProvidersSsoProviderIdWithResponse call
|
|
func ParseGetAdminSsoProvidersSsoProviderIdResponse(rsp *http.Response) (*GetAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAdminSsoProvidersSsoProviderIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest SSOProviderSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePutAdminSsoProvidersSsoProviderIdResponse parses an HTTP response from a PutAdminSsoProvidersSsoProviderIdWithResponse call
|
|
func ParsePutAdminSsoProvidersSsoProviderIdResponse(rsp *http.Response) (*PutAdminSsoProvidersSsoProviderIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PutAdminSsoProvidersSsoProviderIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest SSOProviderSchema
|
|
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 ErrorSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetAdminUsersResponse parses an HTTP response from a GetAdminUsersWithResponse call
|
|
func ParseGetAdminUsersResponse(rsp *http.Response) (*GetAdminUsersResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAdminUsersResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Aud *string `json:"aud,omitempty"`
|
|
Users *[]UserSchema `json:"users,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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseDeleteAdminUsersUserIdResponse parses an HTTP response from a DeleteAdminUsersUserIdWithResponse call
|
|
func ParseDeleteAdminUsersUserIdResponse(rsp *http.Response) (*DeleteAdminUsersUserIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &DeleteAdminUsersUserIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest UserSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetAdminUsersUserIdResponse parses an HTTP response from a GetAdminUsersUserIdWithResponse call
|
|
func ParseGetAdminUsersUserIdResponse(rsp *http.Response) (*GetAdminUsersUserIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAdminUsersUserIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest UserSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePutAdminUsersUserIdResponse parses an HTTP response from a PutAdminUsersUserIdWithResponse call
|
|
func ParsePutAdminUsersUserIdResponse(rsp *http.Response) (*PutAdminUsersUserIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PutAdminUsersUserIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest UserSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetAdminUsersUserIdFactorsResponse parses an HTTP response from a GetAdminUsersUserIdFactorsWithResponse call
|
|
func ParseGetAdminUsersUserIdFactorsResponse(rsp *http.Response) (*GetAdminUsersUserIdFactorsResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAdminUsersUserIdFactorsResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []MFAFactorSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseDeleteAdminUsersUserIdFactorsFactorIdResponse parses an HTTP response from a DeleteAdminUsersUserIdFactorsFactorIdWithResponse call
|
|
func ParseDeleteAdminUsersUserIdFactorsFactorIdResponse(rsp *http.Response) (*DeleteAdminUsersUserIdFactorsFactorIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &DeleteAdminUsersUserIdFactorsFactorIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest MFAFactorSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePutAdminUsersUserIdFactorsFactorIdResponse parses an HTTP response from a PutAdminUsersUserIdFactorsFactorIdWithResponse call
|
|
func ParsePutAdminUsersUserIdFactorsFactorIdResponse(rsp *http.Response) (*PutAdminUsersUserIdFactorsFactorIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PutAdminUsersUserIdFactorsFactorIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest MFAFactorSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePostGenerateLinkResponse parses an HTTP response from a PostGenerateLinkWithResponse call
|
|
func ParsePostGenerateLinkResponse(rsp *http.Response) (*PostGenerateLinkResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PostGenerateLinkResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
ActionLink *string `json:"action_link,omitempty"`
|
|
EmailOtp *string `json:"email_otp,omitempty"`
|
|
HashedToken *string `json:"hashed_token,omitempty"`
|
|
RedirectTo *string `json:"redirect_to,omitempty"`
|
|
VerificationType *string `json:"verification_type,omitempty"`
|
|
AdditionalProperties map[string]interface{} `json:"-"`
|
|
}
|
|
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 ErrorSchema
|
|
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 == 401:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON401 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON403 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest ErrorSchema
|
|
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 == 422:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePostInviteResponse parses an HTTP response from a PostInviteWithResponse call
|
|
func ParsePostInviteResponse(rsp *http.Response) (*PostInviteResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PostInviteResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest UserSchema
|
|
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 ErrorSchema
|
|
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 == 422:
|
|
var dest ErrorSchema
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON422 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|