// Package astroiamcore provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.0 DO NOT EDIT.
package astroiamcore

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"strings"
	"time"

	"github.com/oapi-codegen/runtime"
)

const (
	JWTScopes = "JWT.Scopes"
)

// Defines values for ApiTokenType.
const (
	ApiTokenTypeDEPLOYMENT   ApiTokenType = "DEPLOYMENT"
	ApiTokenTypeORGANIZATION ApiTokenType = "ORGANIZATION"
	ApiTokenTypeWORKSPACE    ApiTokenType = "WORKSPACE"
)

// Defines values for ApiTokenRoleEntityType.
const (
	ApiTokenRoleEntityTypeDEPLOYMENT   ApiTokenRoleEntityType = "DEPLOYMENT"
	ApiTokenRoleEntityTypeORGANIZATION ApiTokenRoleEntityType = "ORGANIZATION"
	ApiTokenRoleEntityTypeWORKSPACE    ApiTokenRoleEntityType = "WORKSPACE"
)

// Defines values for BasicSubjectProfileSubjectType.
const (
	SERVICEKEY BasicSubjectProfileSubjectType = "SERVICEKEY"
	USER       BasicSubjectProfileSubjectType = "USER"
)

// Defines values for CreateApiTokenRequestType.
const (
	DEPLOYMENT   CreateApiTokenRequestType = "DEPLOYMENT"
	ORGANIZATION CreateApiTokenRequestType = "ORGANIZATION"
	WORKSPACE    CreateApiTokenRequestType = "WORKSPACE"
)

// Defines values for CreateTeamRequestOrganizationRole.
const (
	CreateTeamRequestOrganizationRoleORGANIZATIONBILLINGADMIN  CreateTeamRequestOrganizationRole = "ORGANIZATION_BILLING_ADMIN"
	CreateTeamRequestOrganizationRoleORGANIZATIONMEMBER        CreateTeamRequestOrganizationRole = "ORGANIZATION_MEMBER"
	CreateTeamRequestOrganizationRoleORGANIZATIONOBSERVEADMIN  CreateTeamRequestOrganizationRole = "ORGANIZATION_OBSERVE_ADMIN"
	CreateTeamRequestOrganizationRoleORGANIZATIONOBSERVEMEMBER CreateTeamRequestOrganizationRole = "ORGANIZATION_OBSERVE_MEMBER"
	CreateTeamRequestOrganizationRoleORGANIZATIONOWNER         CreateTeamRequestOrganizationRole = "ORGANIZATION_OWNER"
)

// Defines values for CreateUserInviteRequestRole.
const (
	CreateUserInviteRequestRoleORGANIZATIONBILLINGADMIN  CreateUserInviteRequestRole = "ORGANIZATION_BILLING_ADMIN"
	CreateUserInviteRequestRoleORGANIZATIONMEMBER        CreateUserInviteRequestRole = "ORGANIZATION_MEMBER"
	CreateUserInviteRequestRoleORGANIZATIONOBSERVEADMIN  CreateUserInviteRequestRole = "ORGANIZATION_OBSERVE_ADMIN"
	CreateUserInviteRequestRoleORGANIZATIONOBSERVEMEMBER CreateUserInviteRequestRole = "ORGANIZATION_OBSERVE_MEMBER"
	CreateUserInviteRequestRoleORGANIZATIONOWNER         CreateUserInviteRequestRole = "ORGANIZATION_OWNER"
)

// Defines values for SubjectRolesOrganizationRole.
const (
	SubjectRolesOrganizationRoleORGANIZATIONBILLINGADMIN  SubjectRolesOrganizationRole = "ORGANIZATION_BILLING_ADMIN"
	SubjectRolesOrganizationRoleORGANIZATIONMEMBER        SubjectRolesOrganizationRole = "ORGANIZATION_MEMBER"
	SubjectRolesOrganizationRoleORGANIZATIONOBSERVEADMIN  SubjectRolesOrganizationRole = "ORGANIZATION_OBSERVE_ADMIN"
	SubjectRolesOrganizationRoleORGANIZATIONOBSERVEMEMBER SubjectRolesOrganizationRole = "ORGANIZATION_OBSERVE_MEMBER"
	SubjectRolesOrganizationRoleORGANIZATIONOWNER         SubjectRolesOrganizationRole = "ORGANIZATION_OWNER"
)

// Defines values for TeamOrganizationRole.
const (
	TeamOrganizationRoleORGANIZATIONBILLINGADMIN  TeamOrganizationRole = "ORGANIZATION_BILLING_ADMIN"
	TeamOrganizationRoleORGANIZATIONMEMBER        TeamOrganizationRole = "ORGANIZATION_MEMBER"
	TeamOrganizationRoleORGANIZATIONOBSERVEADMIN  TeamOrganizationRole = "ORGANIZATION_OBSERVE_ADMIN"
	TeamOrganizationRoleORGANIZATIONOBSERVEMEMBER TeamOrganizationRole = "ORGANIZATION_OBSERVE_MEMBER"
	TeamOrganizationRoleORGANIZATIONOWNER         TeamOrganizationRole = "ORGANIZATION_OWNER"
)

// Defines values for UpdateTeamRolesRequestOrganizationRole.
const (
	UpdateTeamRolesRequestOrganizationRoleORGANIZATIONBILLINGADMIN  UpdateTeamRolesRequestOrganizationRole = "ORGANIZATION_BILLING_ADMIN"
	UpdateTeamRolesRequestOrganizationRoleORGANIZATIONMEMBER        UpdateTeamRolesRequestOrganizationRole = "ORGANIZATION_MEMBER"
	UpdateTeamRolesRequestOrganizationRoleORGANIZATIONOBSERVEADMIN  UpdateTeamRolesRequestOrganizationRole = "ORGANIZATION_OBSERVE_ADMIN"
	UpdateTeamRolesRequestOrganizationRoleORGANIZATIONOBSERVEMEMBER UpdateTeamRolesRequestOrganizationRole = "ORGANIZATION_OBSERVE_MEMBER"
	UpdateTeamRolesRequestOrganizationRoleORGANIZATIONOWNER         UpdateTeamRolesRequestOrganizationRole = "ORGANIZATION_OWNER"
)

// Defines values for UpdateUserRolesRequestOrganizationRole.
const (
	UpdateUserRolesRequestOrganizationRoleORGANIZATIONBILLINGADMIN  UpdateUserRolesRequestOrganizationRole = "ORGANIZATION_BILLING_ADMIN"
	UpdateUserRolesRequestOrganizationRoleORGANIZATIONMEMBER        UpdateUserRolesRequestOrganizationRole = "ORGANIZATION_MEMBER"
	UpdateUserRolesRequestOrganizationRoleORGANIZATIONOBSERVEADMIN  UpdateUserRolesRequestOrganizationRole = "ORGANIZATION_OBSERVE_ADMIN"
	UpdateUserRolesRequestOrganizationRoleORGANIZATIONOBSERVEMEMBER UpdateUserRolesRequestOrganizationRole = "ORGANIZATION_OBSERVE_MEMBER"
	UpdateUserRolesRequestOrganizationRoleORGANIZATIONOWNER         UpdateUserRolesRequestOrganizationRole = "ORGANIZATION_OWNER"
)

// Defines values for UserOrganizationRole.
const (
	ORGANIZATIONBILLINGADMIN  UserOrganizationRole = "ORGANIZATION_BILLING_ADMIN"
	ORGANIZATIONMEMBER        UserOrganizationRole = "ORGANIZATION_MEMBER"
	ORGANIZATIONOBSERVEADMIN  UserOrganizationRole = "ORGANIZATION_OBSERVE_ADMIN"
	ORGANIZATIONOBSERVEMEMBER UserOrganizationRole = "ORGANIZATION_OBSERVE_MEMBER"
	ORGANIZATIONOWNER         UserOrganizationRole = "ORGANIZATION_OWNER"
)

// Defines values for UserStatus.
const (
	ACTIVE   UserStatus = "ACTIVE"
	BANNED   UserStatus = "BANNED"
	INACTIVE UserStatus = "INACTIVE"
	PENDING  UserStatus = "PENDING"
)

// Defines values for WorkspaceRoleRole.
const (
	WORKSPACEACCESSOR WorkspaceRoleRole = "WORKSPACE_ACCESSOR"
	WORKSPACEAUTHOR   WorkspaceRoleRole = "WORKSPACE_AUTHOR"
	WORKSPACEMEMBER   WorkspaceRoleRole = "WORKSPACE_MEMBER"
	WORKSPACEOPERATOR WorkspaceRoleRole = "WORKSPACE_OPERATOR"
	WORKSPACEOWNER    WorkspaceRoleRole = "WORKSPACE_OWNER"
)

// Defines values for ListTeamsParamsSorts.
const (
	ListTeamsParamsSortsCreatedAtAsc    ListTeamsParamsSorts = "createdAt:asc"
	ListTeamsParamsSortsCreatedAtDesc   ListTeamsParamsSorts = "createdAt:desc"
	ListTeamsParamsSortsDescriptionAsc  ListTeamsParamsSorts = "description:asc"
	ListTeamsParamsSortsDescriptionDesc ListTeamsParamsSorts = "description:desc"
	ListTeamsParamsSortsNameAsc         ListTeamsParamsSorts = "name:asc"
	ListTeamsParamsSortsNameDesc        ListTeamsParamsSorts = "name:desc"
	ListTeamsParamsSortsUpdatedAtAsc    ListTeamsParamsSorts = "updatedAt:asc"
	ListTeamsParamsSortsUpdatedAtDesc   ListTeamsParamsSorts = "updatedAt:desc"
)

// Defines values for ListTeamMembersParamsSorts.
const (
	ListTeamMembersParamsSortsCreatedAtAsc  ListTeamMembersParamsSorts = "createdAt:asc"
	ListTeamMembersParamsSortsCreatedAtDesc ListTeamMembersParamsSorts = "createdAt:desc"
	ListTeamMembersParamsSortsFullNameAsc   ListTeamMembersParamsSorts = "fullName:asc"
	ListTeamMembersParamsSortsFullNameDesc  ListTeamMembersParamsSorts = "fullName:desc"
	ListTeamMembersParamsSortsUserIdAsc     ListTeamMembersParamsSorts = "userId:asc"
	ListTeamMembersParamsSortsUserIdDesc    ListTeamMembersParamsSorts = "userId:desc"
	ListTeamMembersParamsSortsUsernameAsc   ListTeamMembersParamsSorts = "username:asc"
	ListTeamMembersParamsSortsUsernameDesc  ListTeamMembersParamsSorts = "username:desc"
)

// Defines values for ListApiTokensParamsSorts.
const (
	ListApiTokensParamsSortsCreatedAtAsc     ListApiTokensParamsSorts = "createdAt:asc"
	ListApiTokensParamsSortsCreatedAtDesc    ListApiTokensParamsSorts = "createdAt:desc"
	ListApiTokensParamsSortsDescriptionAsc   ListApiTokensParamsSorts = "description:asc"
	ListApiTokensParamsSortsDescriptionDesc  ListApiTokensParamsSorts = "description:desc"
	ListApiTokensParamsSortsNameAsc          ListApiTokensParamsSorts = "name:asc"
	ListApiTokensParamsSortsNameDesc         ListApiTokensParamsSorts = "name:desc"
	ListApiTokensParamsSortsTokenStartAtAsc  ListApiTokensParamsSorts = "tokenStartAt:asc"
	ListApiTokensParamsSortsTokenStartAtDesc ListApiTokensParamsSorts = "tokenStartAt:desc"
	ListApiTokensParamsSortsUpdatedAtAsc     ListApiTokensParamsSorts = "updatedAt:asc"
	ListApiTokensParamsSortsUpdatedAtDesc    ListApiTokensParamsSorts = "updatedAt:desc"
)

// Defines values for ListUsersParamsSorts.
const (
	ListUsersParamsSortsCreatedAtAsc  ListUsersParamsSorts = "createdAt:asc"
	ListUsersParamsSortsCreatedAtDesc ListUsersParamsSorts = "createdAt:desc"
	ListUsersParamsSortsFullNameAsc   ListUsersParamsSorts = "fullName:asc"
	ListUsersParamsSortsFullNameDesc  ListUsersParamsSorts = "fullName:desc"
	ListUsersParamsSortsIdAsc         ListUsersParamsSorts = "id:asc"
	ListUsersParamsSortsIdDesc        ListUsersParamsSorts = "id:desc"
	ListUsersParamsSortsUpdatedAtAsc  ListUsersParamsSorts = "updatedAt:asc"
	ListUsersParamsSortsUpdatedAtDesc ListUsersParamsSorts = "updatedAt:desc"
	ListUsersParamsSortsUsernameAsc   ListUsersParamsSorts = "username:asc"
	ListUsersParamsSortsUsernameDesc  ListUsersParamsSorts = "username:desc"
)

// AddTeamMembersRequest defines model for AddTeamMembersRequest.
type AddTeamMembersRequest struct {
	// MemberIds The list of IDs for users to add to the Team.
	MemberIds []string `json:"memberIds"`
}

// ApiToken defines model for ApiToken.
type ApiToken struct {
	// CreatedAt The time when the API token was created in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	CreatedAt time.Time            `json:"createdAt"`
	CreatedBy *BasicSubjectProfile `json:"createdBy,omitempty"`

	// Description The description of the API token.
	Description string `json:"description"`

	// EndAt The time when the API token expires in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	EndAt *time.Time `json:"endAt,omitempty"`

	// ExpiryPeriodInDays The expiry period of the API token in days.
	ExpiryPeriodInDays *int `json:"expiryPeriodInDays,omitempty"`

	// Id The API token's ID.
	Id string `json:"id"`

	// LastUsedAt The time when the API token was last used in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`

	// Name The name of the API token.
	Name string `json:"name"`

	// Roles The roles of the API token.
	Roles *[]ApiTokenRole `json:"roles,omitempty"`

	// ShortToken The short value of the API token.
	ShortToken string `json:"shortToken"`

	// StartAt The time when the API token will become valid in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	StartAt time.Time `json:"startAt"`

	// Token The value of the API token.
	Token *string `json:"token,omitempty"`

	// Type The type of the API token.
	Type ApiTokenType `json:"type"`

	// UpdatedAt The time when the API token was last updated in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	UpdatedAt time.Time            `json:"updatedAt"`
	UpdatedBy *BasicSubjectProfile `json:"updatedBy,omitempty"`
}

// ApiTokenType The type of the API token.
type ApiTokenType string

// ApiTokenRole defines model for ApiTokenRole.
type ApiTokenRole struct {
	// EntityId The ID of the entity to which the API token is scoped for. For example, for Workspace API tokens, this is the Workspace ID.
	EntityId string `json:"entityId"`

	// EntityType The type of the entity to which the API token is scoped for.
	EntityType ApiTokenRoleEntityType `json:"entityType"`

	// Role The role of the API token.
	Role string `json:"role"`
}

// ApiTokenRoleEntityType The type of the entity to which the API token is scoped for.
type ApiTokenRoleEntityType string

// ApiTokensPaginated defines model for ApiTokensPaginated.
type ApiTokensPaginated struct {
	// Limit The limit of values in this page.
	Limit int `json:"limit"`

	// Offset The offset of values in this page.
	Offset int `json:"offset"`

	// Tokens The list of API tokens in this page.
	Tokens []ApiToken `json:"tokens"`

	// TotalCount The total number of API tokens.
	TotalCount int `json:"totalCount"`
}

// BasicSubjectProfile defines model for BasicSubjectProfile.
type BasicSubjectProfile struct {
	// ApiTokenName The API token's name. Returned only when `SubjectType` is `SERVICEKEY`.
	ApiTokenName *string `json:"apiTokenName,omitempty"`

	// AvatarUrl The URL for the user's profile image. Returned only when `SubjectType` is `USER`.
	AvatarUrl *string `json:"avatarUrl,omitempty"`

	// FullName The subject's full name. Returned only when `SubjectType` is `USER`.
	FullName *string `json:"fullName,omitempty"`

	// Id The subject's ID.
	Id string `json:"id"`

	// SubjectType The subject type.
	SubjectType *BasicSubjectProfileSubjectType `json:"subjectType,omitempty"`

	// Username The subject's username. Returned only when `SubjectType` is `USER`.
	Username *string `json:"username,omitempty"`
}

// BasicSubjectProfileSubjectType The subject type.
type BasicSubjectProfileSubjectType string

// CreateApiTokenRequest defines model for CreateApiTokenRequest.
type CreateApiTokenRequest struct {
	// Description The description for the API token.
	Description *string `json:"description,omitempty"`

	// EntityId The ID of the Workspace or Deployment to which the API token is scoped. It is required if `Type` is `WORKSPACE` or `DEPLOYMENT`.
	EntityId *string `json:"entityId,omitempty"`

	// Name The name of the API token.
	Name string `json:"name"`

	// Role The role of the API token.
	Role string `json:"role"`

	// TokenExpiryPeriodInDays The expiry period of the API token in days. If not specified, the token will never expire.
	TokenExpiryPeriodInDays *int `json:"tokenExpiryPeriodInDays,omitempty"`

	// Type The scope of the API token.
	Type CreateApiTokenRequestType `json:"type"`
}

// CreateApiTokenRequestType The scope of the API token.
type CreateApiTokenRequestType string

// CreateTeamRequest defines model for CreateTeamRequest.
type CreateTeamRequest struct {
	// Description The Team's description.
	Description *string `json:"description,omitempty"`

	// MemberIds The list of IDs for users to add to the Team.
	MemberIds *[]string `json:"memberIds,omitempty"`

	// Name The Team's name.
	Name string `json:"name"`

	// OrganizationRole The Team's Organization role.
	OrganizationRole *CreateTeamRequestOrganizationRole `json:"organizationRole,omitempty"`
}

// CreateTeamRequestOrganizationRole The Team's Organization role.
type CreateTeamRequestOrganizationRole string

// CreateUserInviteRequest defines model for CreateUserInviteRequest.
type CreateUserInviteRequest struct {
	// InviteeEmail The email of the user to invite.
	InviteeEmail string `json:"inviteeEmail"`

	// Role The user's Organization role.
	Role CreateUserInviteRequestRole `json:"role"`
}

// CreateUserInviteRequestRole The user's Organization role.
type CreateUserInviteRequestRole string

// DeploymentRole defines model for DeploymentRole.
type DeploymentRole struct {
	// DeploymentId The Deployment ID.
	DeploymentId string `json:"deploymentId"`

	// Role The name of the role for the subject in the Deployment.
	Role string `json:"role"`
}

// Error defines model for Error.
type Error struct {
	Message    string `json:"message"`
	RequestId  string `json:"requestId"`
	StatusCode int    `json:"statusCode"`
}

// Invite defines model for Invite.
type Invite struct {
	// ExpiresAt The time when the invite is expired in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	ExpiresAt string `json:"expiresAt"`

	// InviteId The invite ID.
	InviteId string              `json:"inviteId"`
	Invitee  BasicSubjectProfile `json:"invitee"`
	Inviter  BasicSubjectProfile `json:"inviter"`

	// OrganizationId The ID of the Organization where the invite was sent.
	OrganizationId string `json:"organizationId"`

	// OrganizationName The name of the Organization where the invite was sent.
	OrganizationName *string `json:"organizationName,omitempty"`

	// UserId The ID for the user who was invited.
	UserId *string `json:"userId,omitempty"`
}

// SubjectRoles defines model for SubjectRoles.
type SubjectRoles struct {
	// DeploymentRoles A list of the subject's Deployment roles. Currently only for API tokens.
	DeploymentRoles *[]DeploymentRole `json:"deploymentRoles,omitempty"`

	// OrganizationRole The subject's Organization role.
	OrganizationRole *SubjectRolesOrganizationRole `json:"organizationRole,omitempty"`

	// WorkspaceRoles A list of the subject's Workspace roles.
	WorkspaceRoles *[]WorkspaceRole `json:"workspaceRoles,omitempty"`
}

// SubjectRolesOrganizationRole The subject's Organization role.
type SubjectRolesOrganizationRole string

// Team defines model for Team.
type Team struct {
	// CreatedAt The time when the Team was created in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	CreatedAt time.Time            `json:"createdAt"`
	CreatedBy *BasicSubjectProfile `json:"createdBy,omitempty"`

	// DeploymentRoles The Team's role in each Deployment it belongs to.
	DeploymentRoles *[]DeploymentRole `json:"deploymentRoles,omitempty"`

	// Description The Team's description.
	Description *string `json:"description,omitempty"`

	// Id The Team's ID.
	Id string `json:"id"`

	// IsIdpManaged Whether the Team is managed by an identity provider (IdP).
	IsIdpManaged bool `json:"isIdpManaged"`

	// Name The Team's name.
	Name string `json:"name"`

	// OrganizationId The ID of the Organization to which the Team belongs.
	OrganizationId string `json:"organizationId"`

	// OrganizationRole The Team's Organization role.
	OrganizationRole TeamOrganizationRole `json:"organizationRole"`

	// RolesCount The number of roles the Team has.
	RolesCount *int `json:"rolesCount,omitempty"`

	// UpdatedAt The time when the Team was last updated in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	UpdatedAt time.Time            `json:"updatedAt"`
	UpdatedBy *BasicSubjectProfile `json:"updatedBy,omitempty"`

	// WorkspaceRoles The Team's role in each Workspace it belongs to.
	WorkspaceRoles *[]WorkspaceRole `json:"workspaceRoles,omitempty"`
}

// TeamOrganizationRole The Team's Organization role.
type TeamOrganizationRole string

// TeamMember defines model for TeamMember.
type TeamMember struct {
	// AvatarUrl The URL for the Team member's profile image.
	AvatarUrl *string `json:"avatarUrl,omitempty"`

	// CreatedAt The time when the Team member was added in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// FullName The Team member's full name.
	FullName *string `json:"fullName,omitempty"`

	// UserId The Team member's ID.
	UserId string `json:"userId"`

	// Username The Team member's username.
	Username string `json:"username"`
}

// TeamMembersPaginated defines model for TeamMembersPaginated.
type TeamMembersPaginated struct {
	// Limit The maximum number of Team members in one page.
	Limit int `json:"limit"`

	// Offset The offset of the current page of Team members.
	Offset int `json:"offset"`

	// TeamMembers The list of Team members in the current page.
	TeamMembers []TeamMember `json:"teamMembers"`

	// TotalCount The total number of Team members.
	TotalCount int `json:"totalCount"`
}

// TeamsPaginated defines model for TeamsPaginated.
type TeamsPaginated struct {
	// Limit The maximum number of Teams in one page.
	Limit int `json:"limit"`

	// Offset The offset of the current page of Teams.
	Offset int `json:"offset"`

	// Teams The list of Teams in the current page.
	Teams []Team `json:"teams"`

	// TotalCount The total number of Teams.
	TotalCount int `json:"totalCount"`
}

// UpdateApiTokenRequest defines model for UpdateApiTokenRequest.
type UpdateApiTokenRequest struct {
	// Description The description of the API token.
	Description *string `json:"description,omitempty"`

	// Name The name of the API token.
	Name string `json:"name"`
}

// UpdateApiTokenRolesRequest defines model for UpdateApiTokenRolesRequest.
type UpdateApiTokenRolesRequest struct {
	// Roles The roles of the API token.
	Roles []ApiTokenRole `json:"roles"`
}

// UpdateTeamRequest defines model for UpdateTeamRequest.
type UpdateTeamRequest struct {
	// Description The Team's description.
	Description *string `json:"description,omitempty"`

	// Name The Team's name.
	Name string `json:"name"`
}

// UpdateTeamRolesRequest defines model for UpdateTeamRolesRequest.
type UpdateTeamRolesRequest struct {
	// DeploymentRoles The user's updated Deployment roles. The Deployments you specify must belong to the Team's Organization.
	DeploymentRoles *[]DeploymentRole `json:"deploymentRoles,omitempty"`

	// OrganizationRole The Team's Organization roles.
	OrganizationRole UpdateTeamRolesRequestOrganizationRole `json:"organizationRole"`

	// WorkspaceRoles The Team's updated Workspace roles. The Workspaces you specify must belong to the Team's Organization.
	WorkspaceRoles *[]WorkspaceRole `json:"workspaceRoles,omitempty"`
}

// UpdateTeamRolesRequestOrganizationRole The Team's Organization roles.
type UpdateTeamRolesRequestOrganizationRole string

// UpdateUserRolesRequest defines model for UpdateUserRolesRequest.
type UpdateUserRolesRequest struct {
	// DeploymentRoles The user's updated Deployment roles. Requires also specifying an `OrganizationRole`.
	DeploymentRoles *[]DeploymentRole `json:"deploymentRoles,omitempty"`

	// OrganizationRole The user's updated Organization role.
	OrganizationRole *UpdateUserRolesRequestOrganizationRole `json:"organizationRole,omitempty"`

	// WorkspaceRoles The user's updated Workspace roles. Requires also specifying an `OrganizationRole`.
	WorkspaceRoles *[]WorkspaceRole `json:"workspaceRoles,omitempty"`
}

// UpdateUserRolesRequestOrganizationRole The user's updated Organization role.
type UpdateUserRolesRequestOrganizationRole string

// User defines model for User.
type User struct {
	// AvatarUrl The URL for the user's profile image.
	AvatarUrl string `json:"avatarUrl"`

	// CreatedAt The time when the user was created in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	CreatedAt time.Time `json:"createdAt"`

	// DeploymentRoles The user's Deployment roles.
	DeploymentRoles *[]DeploymentRole `json:"deploymentRoles,omitempty"`

	// FullName The user's full name.
	FullName string `json:"fullName"`

	// Id The user's ID.
	Id string `json:"id"`

	// OrganizationRole The user's Organization role.
	OrganizationRole *UserOrganizationRole `json:"organizationRole,omitempty"`

	// Status The user's status.
	Status UserStatus `json:"status"`

	// UpdatedAt The time when the user was updated in UTC, formatted as `YYYY-MM-DDTHH:MM:SSZ`.
	UpdatedAt time.Time `json:"updatedAt"`

	// Username The user's username.
	Username string `json:"username"`

	// WorkspaceRoles The user's Workspace roles.
	WorkspaceRoles *[]WorkspaceRole `json:"workspaceRoles,omitempty"`
}

// UserOrganizationRole The user's Organization role.
type UserOrganizationRole string

// UserStatus The user's status.
type UserStatus string

// UsersPaginated defines model for UsersPaginated.
type UsersPaginated struct {
	// Limit The maximum number of users in one page.
	Limit int `json:"limit"`

	// Offset The offset of the current page of users.
	Offset int `json:"offset"`

	// TotalCount The total number of users.
	TotalCount int `json:"totalCount"`

	// Users The list of users in the current page.
	Users []User `json:"users"`
}

// WorkspaceRole defines model for WorkspaceRole.
type WorkspaceRole struct {
	// Role The role of the subject in the Workspace.
	Role WorkspaceRoleRole `json:"role"`

	// WorkspaceId The Workspace ID.
	WorkspaceId string `json:"workspaceId"`
}

// WorkspaceRoleRole The role of the subject in the Workspace.
type WorkspaceRoleRole string

// ListTeamsParams defines parameters for ListTeams.
type ListTeamsParams struct {
	// Names A list of names for Teams to filter by. The API returns details only for the specified Teams.
	Names *[]string `form:"names,omitempty" json:"names,omitempty"`

	// Offset Offset for pagination
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit Limit for pagination
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Sorts Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc'
	Sorts *[]ListTeamsParamsSorts `form:"sorts,omitempty" json:"sorts,omitempty"`
}

// ListTeamsParamsSorts defines parameters for ListTeams.
type ListTeamsParamsSorts string

// ListTeamMembersParams defines parameters for ListTeamMembers.
type ListTeamMembersParams struct {
	// Offset Offset for pagination
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit Limit for pagination
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Sorts Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc'
	Sorts *[]ListTeamMembersParamsSorts `form:"sorts,omitempty" json:"sorts,omitempty"`
}

// ListTeamMembersParamsSorts defines parameters for ListTeamMembers.
type ListTeamMembersParamsSorts string

// ListApiTokensParams defines parameters for ListApiTokens.
type ListApiTokensParams struct {
	// WorkspaceId The ID of the Workspace to list API tokens for.
	WorkspaceId *string `form:"workspaceId,omitempty" json:"workspaceId,omitempty"`

	// DeploymentId The ID of the Deployment to list API tokens for.
	DeploymentId *string `form:"deploymentId,omitempty" json:"deploymentId,omitempty"`

	// IncludeOnlyOrganizationTokens Whether to show only Organization API tokens.
	IncludeOnlyOrganizationTokens *bool `form:"includeOnlyOrganizationTokens,omitempty" json:"includeOnlyOrganizationTokens,omitempty"`

	// Offset Offset for pagination
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit Limit for pagination
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Sorts Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc'
	Sorts *[]ListApiTokensParamsSorts `form:"sorts,omitempty" json:"sorts,omitempty"`
}

// ListApiTokensParamsSorts defines parameters for ListApiTokens.
type ListApiTokensParamsSorts string

// ListUsersParams defines parameters for ListUsers.
type ListUsersParams struct {
	// WorkspaceId The ID of the Workspace to filter the list of users for. When specified, the API returns only users belonging to the specified Workspace.
	WorkspaceId *string `form:"workspaceId,omitempty" json:"workspaceId,omitempty"`

	// DeploymentId The ID of the Deployment to filter the list of users for. When specified, the API returns only users belonging to the specified Deployment.
	DeploymentId *string `form:"deploymentId,omitempty" json:"deploymentId,omitempty"`

	// Offset Offset for pagination
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit Limit for pagination
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Sorts Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc'
	Sorts *[]ListUsersParamsSorts `form:"sorts,omitempty" json:"sorts,omitempty"`
}

// ListUsersParamsSorts defines parameters for ListUsers.
type ListUsersParamsSorts string

// CreateUserInviteJSONRequestBody defines body for CreateUserInvite for application/json ContentType.
type CreateUserInviteJSONRequestBody = CreateUserInviteRequest

// CreateTeamJSONRequestBody defines body for CreateTeam for application/json ContentType.
type CreateTeamJSONRequestBody = CreateTeamRequest

// UpdateTeamJSONRequestBody defines body for UpdateTeam for application/json ContentType.
type UpdateTeamJSONRequestBody = UpdateTeamRequest

// AddTeamMembersJSONRequestBody defines body for AddTeamMembers for application/json ContentType.
type AddTeamMembersJSONRequestBody = AddTeamMembersRequest

// UpdateTeamRolesJSONRequestBody defines body for UpdateTeamRoles for application/json ContentType.
type UpdateTeamRolesJSONRequestBody = UpdateTeamRolesRequest

// CreateApiTokenJSONRequestBody defines body for CreateApiToken for application/json ContentType.
type CreateApiTokenJSONRequestBody = CreateApiTokenRequest

// UpdateApiTokenJSONRequestBody defines body for UpdateApiToken for application/json ContentType.
type UpdateApiTokenJSONRequestBody = UpdateApiTokenRequest

// UpdateApiTokenRolesJSONRequestBody defines body for UpdateApiTokenRoles for application/json ContentType.
type UpdateApiTokenRolesJSONRequestBody = UpdateApiTokenRolesRequest

// UpdateUserRolesJSONRequestBody defines body for UpdateUserRoles for application/json ContentType.
type UpdateUserRolesJSONRequestBody = UpdateUserRolesRequest

// 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 {
	// CreateUserInviteWithBody request with any body
	CreateUserInviteWithBody(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateUserInvite(ctx context.Context, organizationId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteUserInvite request
	DeleteUserInvite(ctx context.Context, organizationId string, inviteId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListTeams request
	ListTeams(ctx context.Context, organizationId string, params *ListTeamsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateTeamWithBody request with any body
	CreateTeamWithBody(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateTeam(ctx context.Context, organizationId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteTeam request
	DeleteTeam(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTeam request
	GetTeam(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateTeamWithBody request with any body
	UpdateTeamWithBody(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateTeam(ctx context.Context, organizationId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListTeamMembers request
	ListTeamMembers(ctx context.Context, organizationId string, teamId string, params *ListTeamMembersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddTeamMembersWithBody request with any body
	AddTeamMembersWithBody(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddTeamMembers(ctx context.Context, organizationId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RemoveTeamMember request
	RemoveTeamMember(ctx context.Context, organizationId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateTeamRolesWithBody request with any body
	UpdateTeamRolesWithBody(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateTeamRoles(ctx context.Context, organizationId string, teamId string, body UpdateTeamRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListApiTokens request
	ListApiTokens(ctx context.Context, organizationId string, params *ListApiTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateApiTokenWithBody request with any body
	CreateApiTokenWithBody(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateApiToken(ctx context.Context, organizationId string, body CreateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteApiToken request
	DeleteApiToken(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiToken request
	GetApiToken(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateApiTokenWithBody request with any body
	UpdateApiTokenWithBody(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateApiToken(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateApiTokenRolesWithBody request with any body
	UpdateApiTokenRolesWithBody(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateApiTokenRoles(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RotateApiToken request
	RotateApiToken(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListUsers request
	ListUsers(ctx context.Context, organizationId string, params *ListUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUser request
	GetUser(ctx context.Context, organizationId string, userId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateUserRolesWithBody request with any body
	UpdateUserRolesWithBody(ctx context.Context, organizationId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateUserRoles(ctx context.Context, organizationId string, userId string, body UpdateUserRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

func (c *Client) CreateUserInviteWithBody(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateUserInviteRequestWithBody(c.Server, organizationId, 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) CreateUserInvite(ctx context.Context, organizationId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateUserInviteRequest(c.Server, organizationId, 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) DeleteUserInvite(ctx context.Context, organizationId string, inviteId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewDeleteUserInviteRequest(c.Server, organizationId, inviteId)
	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) ListTeams(ctx context.Context, organizationId string, params *ListTeamsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewListTeamsRequest(c.Server, organizationId, 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) CreateTeamWithBody(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateTeamRequestWithBody(c.Server, organizationId, 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) CreateTeam(ctx context.Context, organizationId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateTeamRequest(c.Server, organizationId, 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) DeleteTeam(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewDeleteTeamRequest(c.Server, organizationId, teamId)
	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) GetTeam(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGetTeamRequest(c.Server, organizationId, teamId)
	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) UpdateTeamWithBody(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateTeamRequestWithBody(c.Server, organizationId, teamId, 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) UpdateTeam(ctx context.Context, organizationId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateTeamRequest(c.Server, organizationId, teamId, 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) ListTeamMembers(ctx context.Context, organizationId string, teamId string, params *ListTeamMembersParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewListTeamMembersRequest(c.Server, organizationId, teamId, 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) AddTeamMembersWithBody(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewAddTeamMembersRequestWithBody(c.Server, organizationId, teamId, 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) AddTeamMembers(ctx context.Context, organizationId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewAddTeamMembersRequest(c.Server, organizationId, teamId, 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) RemoveTeamMember(ctx context.Context, organizationId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewRemoveTeamMemberRequest(c.Server, organizationId, teamId, memberId)
	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) UpdateTeamRolesWithBody(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateTeamRolesRequestWithBody(c.Server, organizationId, teamId, 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) UpdateTeamRoles(ctx context.Context, organizationId string, teamId string, body UpdateTeamRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateTeamRolesRequest(c.Server, organizationId, teamId, 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) ListApiTokens(ctx context.Context, organizationId string, params *ListApiTokensParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewListApiTokensRequest(c.Server, organizationId, 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) CreateApiTokenWithBody(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateApiTokenRequestWithBody(c.Server, organizationId, 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) CreateApiToken(ctx context.Context, organizationId string, body CreateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateApiTokenRequest(c.Server, organizationId, 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) DeleteApiToken(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewDeleteApiTokenRequest(c.Server, organizationId, tokenId)
	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) GetApiToken(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGetApiTokenRequest(c.Server, organizationId, tokenId)
	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) UpdateApiTokenWithBody(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateApiTokenRequestWithBody(c.Server, organizationId, tokenId, 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) UpdateApiToken(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateApiTokenRequest(c.Server, organizationId, tokenId, 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) UpdateApiTokenRolesWithBody(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateApiTokenRolesRequestWithBody(c.Server, organizationId, tokenId, 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) UpdateApiTokenRoles(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateApiTokenRolesRequest(c.Server, organizationId, tokenId, 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) RotateApiToken(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewRotateApiTokenRequest(c.Server, organizationId, tokenId)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) ListUsers(ctx context.Context, organizationId string, params *ListUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewListUsersRequest(c.Server, organizationId, 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) GetUser(ctx context.Context, organizationId string, userId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewGetUserRequest(c.Server, organizationId, 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) UpdateUserRolesWithBody(ctx context.Context, organizationId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateUserRolesRequestWithBody(c.Server, organizationId, 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) UpdateUserRoles(ctx context.Context, organizationId string, userId string, body UpdateUserRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUpdateUserRolesRequest(c.Server, organizationId, 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)
}

// NewCreateUserInviteRequest calls the generic CreateUserInvite builder with application/json body
func NewCreateUserInviteRequest(server string, organizationId string, body CreateUserInviteJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateUserInviteRequestWithBody(server, organizationId, "application/json", bodyReader)
}

// NewCreateUserInviteRequestWithBody generates requests for CreateUserInvite with any type of body
func NewCreateUserInviteRequestWithBody(server string, organizationId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/invites", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewDeleteUserInviteRequest generates requests for DeleteUserInvite
func NewDeleteUserInviteRequest(server string, organizationId string, inviteId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/invites/%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
}

// NewListTeamsRequest generates requests for ListTeams
func NewListTeamsRequest(server string, organizationId string, params *ListTeamsParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Names != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "names", runtime.ParamLocationQuery, *params.Names); 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.Offset != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); 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.Limit != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); 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.Sorts != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); 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
}

// NewCreateTeamRequest calls the generic CreateTeam builder with application/json body
func NewCreateTeamRequest(server string, organizationId string, body CreateTeamJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateTeamRequestWithBody(server, organizationId, "application/json", bodyReader)
}

// NewCreateTeamRequestWithBody generates requests for CreateTeam with any type of body
func NewCreateTeamRequestWithBody(server string, organizationId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewDeleteTeamRequest generates requests for DeleteTeam
func NewDeleteTeamRequest(server string, organizationId string, teamId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%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
}

// NewGetTeamRequest generates requests for GetTeam
func NewGetTeamRequest(server string, organizationId string, teamId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewUpdateTeamRequest calls the generic UpdateTeam builder with application/json body
func NewUpdateTeamRequest(server string, organizationId string, teamId string, body UpdateTeamJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewUpdateTeamRequestWithBody(server, organizationId, teamId, "application/json", bodyReader)
}

// NewUpdateTeamRequestWithBody generates requests for UpdateTeam with any type of body
func NewUpdateTeamRequestWithBody(server string, organizationId string, teamId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%s", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewListTeamMembersRequest generates requests for ListTeamMembers
func NewListTeamMembersRequest(server string, organizationId string, teamId string, params *ListTeamMembersParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Offset != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); 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.Limit != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); 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.Sorts != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); 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
}

// NewAddTeamMembersRequest calls the generic AddTeamMembers builder with application/json body
func NewAddTeamMembersRequest(server string, organizationId string, teamId string, body AddTeamMembersJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewAddTeamMembersRequestWithBody(server, organizationId, teamId, "application/json", bodyReader)
}

// NewAddTeamMembersRequestWithBody generates requests for AddTeamMembers with any type of body
func NewAddTeamMembersRequestWithBody(server string, organizationId string, teamId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewRemoveTeamMemberRequest generates requests for RemoveTeamMember
func NewRemoveTeamMemberRequest(server string, organizationId string, teamId string, memberId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	var pathParam2 string

	pathParam2, err = runtime.StyleParamWithLocation("simple", false, "memberId", runtime.ParamLocationPath, memberId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%s/members/%s", pathParam0, pathParam1, pathParam2)
	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
}

// NewUpdateTeamRolesRequest calls the generic UpdateTeamRoles builder with application/json body
func NewUpdateTeamRolesRequest(server string, organizationId string, teamId string, body UpdateTeamRolesJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewUpdateTeamRolesRequestWithBody(server, organizationId, teamId, "application/json", bodyReader)
}

// NewUpdateTeamRolesRequestWithBody generates requests for UpdateTeamRoles with any type of body
func NewUpdateTeamRolesRequestWithBody(server string, organizationId string, teamId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "teamId", runtime.ParamLocationPath, teamId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/teams/%s/roles", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewListApiTokensRequest generates requests for ListApiTokens
func NewListApiTokensRequest(server string, organizationId string, params *ListApiTokensParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.WorkspaceId != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "workspaceId", runtime.ParamLocationQuery, *params.WorkspaceId); 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.DeploymentId != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deploymentId", runtime.ParamLocationQuery, *params.DeploymentId); 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.IncludeOnlyOrganizationTokens != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "includeOnlyOrganizationTokens", runtime.ParamLocationQuery, *params.IncludeOnlyOrganizationTokens); 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.Offset != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); 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.Limit != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); 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.Sorts != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); 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
}

// NewCreateApiTokenRequest calls the generic CreateApiToken builder with application/json body
func NewCreateApiTokenRequest(server string, organizationId string, body CreateApiTokenJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateApiTokenRequestWithBody(server, organizationId, "application/json", bodyReader)
}

// NewCreateApiTokenRequestWithBody generates requests for CreateApiToken with any type of body
func NewCreateApiTokenRequestWithBody(server string, organizationId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewDeleteApiTokenRequest generates requests for DeleteApiToken
func NewDeleteApiTokenRequest(server string, organizationId string, tokenId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tokenId", runtime.ParamLocationPath, tokenId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens/%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
}

// NewGetApiTokenRequest generates requests for GetApiToken
func NewGetApiTokenRequest(server string, organizationId string, tokenId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tokenId", runtime.ParamLocationPath, tokenId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens/%s", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewUpdateApiTokenRequest calls the generic UpdateApiToken builder with application/json body
func NewUpdateApiTokenRequest(server string, organizationId string, tokenId string, body UpdateApiTokenJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewUpdateApiTokenRequestWithBody(server, organizationId, tokenId, "application/json", bodyReader)
}

// NewUpdateApiTokenRequestWithBody generates requests for UpdateApiToken with any type of body
func NewUpdateApiTokenRequestWithBody(server string, organizationId string, tokenId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tokenId", runtime.ParamLocationPath, tokenId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens/%s", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewUpdateApiTokenRolesRequest calls the generic UpdateApiTokenRoles builder with application/json body
func NewUpdateApiTokenRolesRequest(server string, organizationId string, tokenId string, body UpdateApiTokenRolesJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewUpdateApiTokenRolesRequestWithBody(server, organizationId, tokenId, "application/json", bodyReader)
}

// NewUpdateApiTokenRolesRequestWithBody generates requests for UpdateApiTokenRoles with any type of body
func NewUpdateApiTokenRolesRequestWithBody(server string, organizationId string, tokenId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tokenId", runtime.ParamLocationPath, tokenId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens/%s/roles", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewRotateApiTokenRequest generates requests for RotateApiToken
func NewRotateApiTokenRequest(server string, organizationId string, tokenId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, err = runtime.StyleParamWithLocation("simple", false, "tokenId", runtime.ParamLocationPath, tokenId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/tokens/%s/rotate", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewListUsersRequest generates requests for ListUsers
func NewListUsersRequest(server string, organizationId string, params *ListUsersParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/organizations/%s/users", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.WorkspaceId != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "workspaceId", runtime.ParamLocationQuery, *params.WorkspaceId); 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.DeploymentId != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "deploymentId", runtime.ParamLocationQuery, *params.DeploymentId); 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.Offset != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); 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.Limit != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); 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.Sorts != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sorts", runtime.ParamLocationQuery, *params.Sorts); 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
}

// NewGetUserRequest generates requests for GetUser
func NewGetUserRequest(server string, organizationId string, userId string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, 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("/organizations/%s/users/%s", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewUpdateUserRolesRequest calls the generic UpdateUserRoles builder with application/json body
func NewUpdateUserRolesRequest(server string, organizationId string, userId string, body UpdateUserRolesJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewUpdateUserRolesRequestWithBody(server, organizationId, userId, "application/json", bodyReader)
}

// NewUpdateUserRolesRequestWithBody generates requests for UpdateUserRoles with any type of body
func NewUpdateUserRolesRequestWithBody(server string, organizationId string, userId string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "organizationId", runtime.ParamLocationPath, organizationId)
	if err != nil {
		return nil, err
	}

	var pathParam1 string

	pathParam1, 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("/organizations/%s/users/%s/roles", pathParam0, pathParam1)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), 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 {
	// CreateUserInviteWithBodyWithResponse request with any body
	CreateUserInviteWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error)

	CreateUserInviteWithResponse(ctx context.Context, organizationId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error)

	// DeleteUserInviteWithResponse request
	DeleteUserInviteWithResponse(ctx context.Context, organizationId string, inviteId string, reqEditors ...RequestEditorFn) (*DeleteUserInviteResponse, error)

	// ListTeamsWithResponse request
	ListTeamsWithResponse(ctx context.Context, organizationId string, params *ListTeamsParams, reqEditors ...RequestEditorFn) (*ListTeamsResponse, error)

	// CreateTeamWithBodyWithResponse request with any body
	CreateTeamWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error)

	CreateTeamWithResponse(ctx context.Context, organizationId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error)

	// DeleteTeamWithResponse request
	DeleteTeamWithResponse(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteTeamResponse, error)

	// GetTeamWithResponse request
	GetTeamWithResponse(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*GetTeamResponse, error)

	// UpdateTeamWithBodyWithResponse request with any body
	UpdateTeamWithBodyWithResponse(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error)

	UpdateTeamWithResponse(ctx context.Context, organizationId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error)

	// ListTeamMembersWithResponse request
	ListTeamMembersWithResponse(ctx context.Context, organizationId string, teamId string, params *ListTeamMembersParams, reqEditors ...RequestEditorFn) (*ListTeamMembersResponse, error)

	// AddTeamMembersWithBodyWithResponse request with any body
	AddTeamMembersWithBodyWithResponse(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error)

	AddTeamMembersWithResponse(ctx context.Context, organizationId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error)

	// RemoveTeamMemberWithResponse request
	RemoveTeamMemberWithResponse(ctx context.Context, organizationId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*RemoveTeamMemberResponse, error)

	// UpdateTeamRolesWithBodyWithResponse request with any body
	UpdateTeamRolesWithBodyWithResponse(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamRolesResponse, error)

	UpdateTeamRolesWithResponse(ctx context.Context, organizationId string, teamId string, body UpdateTeamRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamRolesResponse, error)

	// ListApiTokensWithResponse request
	ListApiTokensWithResponse(ctx context.Context, organizationId string, params *ListApiTokensParams, reqEditors ...RequestEditorFn) (*ListApiTokensResponse, error)

	// CreateApiTokenWithBodyWithResponse request with any body
	CreateApiTokenWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiTokenResponse, error)

	CreateApiTokenWithResponse(ctx context.Context, organizationId string, body CreateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiTokenResponse, error)

	// DeleteApiTokenWithResponse request
	DeleteApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*DeleteApiTokenResponse, error)

	// GetApiTokenWithResponse request
	GetApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*GetApiTokenResponse, error)

	// UpdateApiTokenWithBodyWithResponse request with any body
	UpdateApiTokenWithBodyWithResponse(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiTokenResponse, error)

	UpdateApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiTokenResponse, error)

	// UpdateApiTokenRolesWithBodyWithResponse request with any body
	UpdateApiTokenRolesWithBodyWithResponse(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiTokenRolesResponse, error)

	UpdateApiTokenRolesWithResponse(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiTokenRolesResponse, error)

	// RotateApiTokenWithResponse request
	RotateApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*RotateApiTokenResponse, error)

	// ListUsersWithResponse request
	ListUsersWithResponse(ctx context.Context, organizationId string, params *ListUsersParams, reqEditors ...RequestEditorFn) (*ListUsersResponse, error)

	// GetUserWithResponse request
	GetUserWithResponse(ctx context.Context, organizationId string, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error)

	// UpdateUserRolesWithBodyWithResponse request with any body
	UpdateUserRolesWithBodyWithResponse(ctx context.Context, organizationId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserRolesResponse, error)

	UpdateUserRolesWithResponse(ctx context.Context, organizationId string, userId string, body UpdateUserRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserRolesResponse, error)
}

type CreateUserInviteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Invite
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r CreateUserInviteResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateUserInviteResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type DeleteUserInviteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r DeleteUserInviteResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r DeleteUserInviteResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type ListTeamsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TeamsPaginated
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r ListTeamsResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r ListTeamsResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateTeamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Team
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r CreateTeamResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateTeamResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type DeleteTeamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r DeleteTeamResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r DeleteTeamResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GetTeamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Team
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r GetTeamResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GetTeamResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type UpdateTeamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Team
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r UpdateTeamResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r UpdateTeamResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type ListTeamMembersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TeamMembersPaginated
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r ListTeamMembersResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r ListTeamMembersResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type AddTeamMembersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r AddTeamMembersResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r AddTeamMembersResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type RemoveTeamMemberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r RemoveTeamMemberResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r RemoveTeamMemberResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type UpdateTeamRolesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SubjectRoles
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r UpdateTeamRolesResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r UpdateTeamRolesResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type ListApiTokensResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiTokensPaginated
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r ListApiTokensResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r ListApiTokensResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateApiTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiToken
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r CreateApiTokenResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateApiTokenResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type DeleteApiTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r DeleteApiTokenResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r DeleteApiTokenResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GetApiTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiToken
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r GetApiTokenResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GetApiTokenResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type UpdateApiTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiToken
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r UpdateApiTokenResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r UpdateApiTokenResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type UpdateApiTokenRolesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SubjectRoles
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r UpdateApiTokenRolesResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r UpdateApiTokenRolesResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type RotateApiTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiToken
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r RotateApiTokenResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r RotateApiTokenResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type ListUsersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UsersPaginated
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r ListUsersResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r ListUsersResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GetUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *User
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r GetUserResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GetUserResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type UpdateUserRolesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SubjectRoles
	JSON400      *Error
	JSON401      *Error
	JSON403      *Error
	JSON404      *Error
	JSON500      *Error
}

// Status returns HTTPResponse.Status
func (r UpdateUserRolesResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r UpdateUserRolesResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// CreateUserInviteWithBodyWithResponse request with arbitrary body returning *CreateUserInviteResponse
func (c *ClientWithResponses) CreateUserInviteWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) {
	rsp, err := c.CreateUserInviteWithBody(ctx, organizationId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateUserInviteResponse(rsp)
}

func (c *ClientWithResponses) CreateUserInviteWithResponse(ctx context.Context, organizationId string, body CreateUserInviteJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserInviteResponse, error) {
	rsp, err := c.CreateUserInvite(ctx, organizationId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateUserInviteResponse(rsp)
}

// DeleteUserInviteWithResponse request returning *DeleteUserInviteResponse
func (c *ClientWithResponses) DeleteUserInviteWithResponse(ctx context.Context, organizationId string, inviteId string, reqEditors ...RequestEditorFn) (*DeleteUserInviteResponse, error) {
	rsp, err := c.DeleteUserInvite(ctx, organizationId, inviteId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseDeleteUserInviteResponse(rsp)
}

// ListTeamsWithResponse request returning *ListTeamsResponse
func (c *ClientWithResponses) ListTeamsWithResponse(ctx context.Context, organizationId string, params *ListTeamsParams, reqEditors ...RequestEditorFn) (*ListTeamsResponse, error) {
	rsp, err := c.ListTeams(ctx, organizationId, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseListTeamsResponse(rsp)
}

// CreateTeamWithBodyWithResponse request with arbitrary body returning *CreateTeamResponse
func (c *ClientWithResponses) CreateTeamWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) {
	rsp, err := c.CreateTeamWithBody(ctx, organizationId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateTeamResponse(rsp)
}

func (c *ClientWithResponses) CreateTeamWithResponse(ctx context.Context, organizationId string, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error) {
	rsp, err := c.CreateTeam(ctx, organizationId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateTeamResponse(rsp)
}

// DeleteTeamWithResponse request returning *DeleteTeamResponse
func (c *ClientWithResponses) DeleteTeamWithResponse(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*DeleteTeamResponse, error) {
	rsp, err := c.DeleteTeam(ctx, organizationId, teamId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseDeleteTeamResponse(rsp)
}

// GetTeamWithResponse request returning *GetTeamResponse
func (c *ClientWithResponses) GetTeamWithResponse(ctx context.Context, organizationId string, teamId string, reqEditors ...RequestEditorFn) (*GetTeamResponse, error) {
	rsp, err := c.GetTeam(ctx, organizationId, teamId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGetTeamResponse(rsp)
}

// UpdateTeamWithBodyWithResponse request with arbitrary body returning *UpdateTeamResponse
func (c *ClientWithResponses) UpdateTeamWithBodyWithResponse(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) {
	rsp, err := c.UpdateTeamWithBody(ctx, organizationId, teamId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateTeamResponse(rsp)
}

func (c *ClientWithResponses) UpdateTeamWithResponse(ctx context.Context, organizationId string, teamId string, body UpdateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamResponse, error) {
	rsp, err := c.UpdateTeam(ctx, organizationId, teamId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateTeamResponse(rsp)
}

// ListTeamMembersWithResponse request returning *ListTeamMembersResponse
func (c *ClientWithResponses) ListTeamMembersWithResponse(ctx context.Context, organizationId string, teamId string, params *ListTeamMembersParams, reqEditors ...RequestEditorFn) (*ListTeamMembersResponse, error) {
	rsp, err := c.ListTeamMembers(ctx, organizationId, teamId, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseListTeamMembersResponse(rsp)
}

// AddTeamMembersWithBodyWithResponse request with arbitrary body returning *AddTeamMembersResponse
func (c *ClientWithResponses) AddTeamMembersWithBodyWithResponse(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) {
	rsp, err := c.AddTeamMembersWithBody(ctx, organizationId, teamId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseAddTeamMembersResponse(rsp)
}

func (c *ClientWithResponses) AddTeamMembersWithResponse(ctx context.Context, organizationId string, teamId string, body AddTeamMembersJSONRequestBody, reqEditors ...RequestEditorFn) (*AddTeamMembersResponse, error) {
	rsp, err := c.AddTeamMembers(ctx, organizationId, teamId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseAddTeamMembersResponse(rsp)
}

// RemoveTeamMemberWithResponse request returning *RemoveTeamMemberResponse
func (c *ClientWithResponses) RemoveTeamMemberWithResponse(ctx context.Context, organizationId string, teamId string, memberId string, reqEditors ...RequestEditorFn) (*RemoveTeamMemberResponse, error) {
	rsp, err := c.RemoveTeamMember(ctx, organizationId, teamId, memberId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseRemoveTeamMemberResponse(rsp)
}

// UpdateTeamRolesWithBodyWithResponse request with arbitrary body returning *UpdateTeamRolesResponse
func (c *ClientWithResponses) UpdateTeamRolesWithBodyWithResponse(ctx context.Context, organizationId string, teamId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTeamRolesResponse, error) {
	rsp, err := c.UpdateTeamRolesWithBody(ctx, organizationId, teamId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateTeamRolesResponse(rsp)
}

func (c *ClientWithResponses) UpdateTeamRolesWithResponse(ctx context.Context, organizationId string, teamId string, body UpdateTeamRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTeamRolesResponse, error) {
	rsp, err := c.UpdateTeamRoles(ctx, organizationId, teamId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateTeamRolesResponse(rsp)
}

// ListApiTokensWithResponse request returning *ListApiTokensResponse
func (c *ClientWithResponses) ListApiTokensWithResponse(ctx context.Context, organizationId string, params *ListApiTokensParams, reqEditors ...RequestEditorFn) (*ListApiTokensResponse, error) {
	rsp, err := c.ListApiTokens(ctx, organizationId, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseListApiTokensResponse(rsp)
}

// CreateApiTokenWithBodyWithResponse request with arbitrary body returning *CreateApiTokenResponse
func (c *ClientWithResponses) CreateApiTokenWithBodyWithResponse(ctx context.Context, organizationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiTokenResponse, error) {
	rsp, err := c.CreateApiTokenWithBody(ctx, organizationId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateApiTokenResponse(rsp)
}

func (c *ClientWithResponses) CreateApiTokenWithResponse(ctx context.Context, organizationId string, body CreateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiTokenResponse, error) {
	rsp, err := c.CreateApiToken(ctx, organizationId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateApiTokenResponse(rsp)
}

// DeleteApiTokenWithResponse request returning *DeleteApiTokenResponse
func (c *ClientWithResponses) DeleteApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*DeleteApiTokenResponse, error) {
	rsp, err := c.DeleteApiToken(ctx, organizationId, tokenId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseDeleteApiTokenResponse(rsp)
}

// GetApiTokenWithResponse request returning *GetApiTokenResponse
func (c *ClientWithResponses) GetApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*GetApiTokenResponse, error) {
	rsp, err := c.GetApiToken(ctx, organizationId, tokenId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGetApiTokenResponse(rsp)
}

// UpdateApiTokenWithBodyWithResponse request with arbitrary body returning *UpdateApiTokenResponse
func (c *ClientWithResponses) UpdateApiTokenWithBodyWithResponse(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiTokenResponse, error) {
	rsp, err := c.UpdateApiTokenWithBody(ctx, organizationId, tokenId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateApiTokenResponse(rsp)
}

func (c *ClientWithResponses) UpdateApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiTokenResponse, error) {
	rsp, err := c.UpdateApiToken(ctx, organizationId, tokenId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateApiTokenResponse(rsp)
}

// UpdateApiTokenRolesWithBodyWithResponse request with arbitrary body returning *UpdateApiTokenRolesResponse
func (c *ClientWithResponses) UpdateApiTokenRolesWithBodyWithResponse(ctx context.Context, organizationId string, tokenId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateApiTokenRolesResponse, error) {
	rsp, err := c.UpdateApiTokenRolesWithBody(ctx, organizationId, tokenId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateApiTokenRolesResponse(rsp)
}

func (c *ClientWithResponses) UpdateApiTokenRolesWithResponse(ctx context.Context, organizationId string, tokenId string, body UpdateApiTokenRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateApiTokenRolesResponse, error) {
	rsp, err := c.UpdateApiTokenRoles(ctx, organizationId, tokenId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateApiTokenRolesResponse(rsp)
}

// RotateApiTokenWithResponse request returning *RotateApiTokenResponse
func (c *ClientWithResponses) RotateApiTokenWithResponse(ctx context.Context, organizationId string, tokenId string, reqEditors ...RequestEditorFn) (*RotateApiTokenResponse, error) {
	rsp, err := c.RotateApiToken(ctx, organizationId, tokenId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseRotateApiTokenResponse(rsp)
}

// ListUsersWithResponse request returning *ListUsersResponse
func (c *ClientWithResponses) ListUsersWithResponse(ctx context.Context, organizationId string, params *ListUsersParams, reqEditors ...RequestEditorFn) (*ListUsersResponse, error) {
	rsp, err := c.ListUsers(ctx, organizationId, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseListUsersResponse(rsp)
}

// GetUserWithResponse request returning *GetUserResponse
func (c *ClientWithResponses) GetUserWithResponse(ctx context.Context, organizationId string, userId string, reqEditors ...RequestEditorFn) (*GetUserResponse, error) {
	rsp, err := c.GetUser(ctx, organizationId, userId, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseGetUserResponse(rsp)
}

// UpdateUserRolesWithBodyWithResponse request with arbitrary body returning *UpdateUserRolesResponse
func (c *ClientWithResponses) UpdateUserRolesWithBodyWithResponse(ctx context.Context, organizationId string, userId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateUserRolesResponse, error) {
	rsp, err := c.UpdateUserRolesWithBody(ctx, organizationId, userId, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateUserRolesResponse(rsp)
}

func (c *ClientWithResponses) UpdateUserRolesWithResponse(ctx context.Context, organizationId string, userId string, body UpdateUserRolesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateUserRolesResponse, error) {
	rsp, err := c.UpdateUserRoles(ctx, organizationId, userId, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUpdateUserRolesResponse(rsp)
}

// ParseCreateUserInviteResponse parses an HTTP response from a CreateUserInviteWithResponse call
func ParseCreateUserInviteResponse(rsp *http.Response) (*CreateUserInviteResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &CreateUserInviteResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest Invite
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseDeleteUserInviteResponse parses an HTTP response from a DeleteUserInviteWithResponse call
func ParseDeleteUserInviteResponse(rsp *http.Response) (*DeleteUserInviteResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &DeleteUserInviteResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseListTeamsResponse parses an HTTP response from a ListTeamsWithResponse call
func ParseListTeamsResponse(rsp *http.Response) (*ListTeamsResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &ListTeamsResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest TeamsPaginated
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseCreateTeamResponse parses an HTTP response from a CreateTeamWithResponse call
func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &CreateTeamResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest Team
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseDeleteTeamResponse parses an HTTP response from a DeleteTeamWithResponse call
func ParseDeleteTeamResponse(rsp *http.Response) (*DeleteTeamResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &DeleteTeamResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseGetTeamResponse parses an HTTP response from a GetTeamWithResponse call
func ParseGetTeamResponse(rsp *http.Response) (*GetTeamResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GetTeamResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest Team
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseUpdateTeamResponse parses an HTTP response from a UpdateTeamWithResponse call
func ParseUpdateTeamResponse(rsp *http.Response) (*UpdateTeamResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &UpdateTeamResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest Team
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseListTeamMembersResponse parses an HTTP response from a ListTeamMembersWithResponse call
func ParseListTeamMembersResponse(rsp *http.Response) (*ListTeamMembersResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &ListTeamMembersResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest TeamMembersPaginated
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseAddTeamMembersResponse parses an HTTP response from a AddTeamMembersWithResponse call
func ParseAddTeamMembersResponse(rsp *http.Response) (*AddTeamMembersResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &AddTeamMembersResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseRemoveTeamMemberResponse parses an HTTP response from a RemoveTeamMemberWithResponse call
func ParseRemoveTeamMemberResponse(rsp *http.Response) (*RemoveTeamMemberResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &RemoveTeamMemberResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseUpdateTeamRolesResponse parses an HTTP response from a UpdateTeamRolesWithResponse call
func ParseUpdateTeamRolesResponse(rsp *http.Response) (*UpdateTeamRolesResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &UpdateTeamRolesResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest SubjectRoles
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseListApiTokensResponse parses an HTTP response from a ListApiTokensWithResponse call
func ParseListApiTokensResponse(rsp *http.Response) (*ListApiTokensResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &ListApiTokensResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ApiTokensPaginated
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseCreateApiTokenResponse parses an HTTP response from a CreateApiTokenWithResponse call
func ParseCreateApiTokenResponse(rsp *http.Response) (*CreateApiTokenResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &CreateApiTokenResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ApiToken
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseDeleteApiTokenResponse parses an HTTP response from a DeleteApiTokenWithResponse call
func ParseDeleteApiTokenResponse(rsp *http.Response) (*DeleteApiTokenResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &DeleteApiTokenResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseGetApiTokenResponse parses an HTTP response from a GetApiTokenWithResponse call
func ParseGetApiTokenResponse(rsp *http.Response) (*GetApiTokenResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GetApiTokenResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ApiToken
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseUpdateApiTokenResponse parses an HTTP response from a UpdateApiTokenWithResponse call
func ParseUpdateApiTokenResponse(rsp *http.Response) (*UpdateApiTokenResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &UpdateApiTokenResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ApiToken
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseUpdateApiTokenRolesResponse parses an HTTP response from a UpdateApiTokenRolesWithResponse call
func ParseUpdateApiTokenRolesResponse(rsp *http.Response) (*UpdateApiTokenRolesResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &UpdateApiTokenRolesResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest SubjectRoles
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseRotateApiTokenResponse parses an HTTP response from a RotateApiTokenWithResponse call
func ParseRotateApiTokenResponse(rsp *http.Response) (*RotateApiTokenResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &RotateApiTokenResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ApiToken
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseListUsersResponse parses an HTTP response from a ListUsersWithResponse call
func ParseListUsersResponse(rsp *http.Response) (*ListUsersResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &ListUsersResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest UsersPaginated
		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 Error
		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 Error
		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 Error
		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 == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseGetUserResponse parses an HTTP response from a GetUserWithResponse call
func ParseGetUserResponse(rsp *http.Response) (*GetUserResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &GetUserResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest User
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseUpdateUserRolesResponse parses an HTTP response from a UpdateUserRolesWithResponse call
func ParseUpdateUserRolesResponse(rsp *http.Response) (*UpdateUserRolesResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &UpdateUserRolesResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest SubjectRoles
		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 Error
		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 Error
		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 Error
		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 Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest Error
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}
