// Package clientv1 provides primitives to interact with the openapi HTTP API. // // Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. package clientv1 import ( "bytes" "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "time" "github.com/oapi-codegen/runtime" ) // Defines values for NodeRegisterMethod. const ( REGISTERMETHODAUTHKEY NodeRegisterMethod = "REGISTER_METHOD_AUTH_KEY" REGISTERMETHODCLI NodeRegisterMethod = "REGISTER_METHOD_CLI" REGISTERMETHODOIDC NodeRegisterMethod = "REGISTER_METHOD_OIDC" REGISTERMETHODUNSPECIFIED NodeRegisterMethod = "REGISTER_METHOD_UNSPECIFIED" ) // Valid indicates whether the value is a known member of the NodeRegisterMethod enum. func (e NodeRegisterMethod) Valid() bool { switch e { case REGISTERMETHODAUTHKEY: return true case REGISTERMETHODCLI: return true case REGISTERMETHODOIDC: return true case REGISTERMETHODUNSPECIFIED: return true default: return false } } // ApiKey defines model for ApiKey. type ApiKey struct { CreatedAt *time.Time `json:"createdAt"` Expiration *time.Time `json:"expiration"` Id string `json:"id"` LastSeen *time.Time `json:"lastSeen"` Prefix string `json:"prefix"` } // AuthApproveOutputBody defines model for AuthApproveOutputBody. type AuthApproveOutputBody = map[string]interface{} // AuthApproveRequestBody defines model for AuthApproveRequestBody. type AuthApproveRequestBody struct { AuthId *string `json:"authId,omitempty"` } // AuthRegisterOutputBody defines model for AuthRegisterOutputBody. type AuthRegisterOutputBody struct { Node Node `json:"node"` } // AuthRegisterRequestBody defines model for AuthRegisterRequestBody. type AuthRegisterRequestBody struct { AuthId *string `json:"authId,omitempty"` User *string `json:"user,omitempty"` } // AuthRejectOutputBody defines model for AuthRejectOutputBody. type AuthRejectOutputBody = map[string]interface{} // AuthRejectRequestBody defines model for AuthRejectRequestBody. type AuthRejectRequestBody struct { AuthId *string `json:"authId,omitempty"` } // BackfillNodeIPsOutputBody defines model for BackfillNodeIPsOutputBody. type BackfillNodeIPsOutputBody struct { Changes []string `json:"changes"` } // CheckPolicyOutputBody defines model for CheckPolicyOutputBody. type CheckPolicyOutputBody = map[string]interface{} // CreateApiKeyOutputBody defines model for CreateApiKeyOutputBody. type CreateApiKeyOutputBody struct { ApiKey string `json:"apiKey"` } // CreateApiKeyRequestBody defines model for CreateApiKeyRequestBody. type CreateApiKeyRequestBody struct { Expiration *time.Time `json:"expiration,omitempty"` } // CreatePreAuthKeyRequestBody defines model for CreatePreAuthKeyRequestBody. type CreatePreAuthKeyRequestBody struct { AclTags *[]string `json:"aclTags,omitempty"` Ephemeral *bool `json:"ephemeral,omitempty"` Expiration *time.Time `json:"expiration,omitempty"` Reusable *bool `json:"reusable,omitempty"` User *string `json:"user,omitempty"` } // CreateUserRequestBody defines model for CreateUserRequestBody. type CreateUserRequestBody struct { DisplayName *string `json:"displayName,omitempty"` Email *string `json:"email,omitempty"` Name *string `json:"name,omitempty"` PictureUrl *string `json:"pictureUrl,omitempty"` } // DebugCreateNodeRequestBody defines model for DebugCreateNodeRequestBody. type DebugCreateNodeRequestBody struct { Key *string `json:"key,omitempty"` Name *string `json:"name,omitempty"` Routes *[]string `json:"routes,omitempty"` User *string `json:"user,omitempty"` } // DeleteApiKeyOutputBody defines model for DeleteApiKeyOutputBody. type DeleteApiKeyOutputBody = map[string]interface{} // DeleteNodeOutputBody defines model for DeleteNodeOutputBody. type DeleteNodeOutputBody = map[string]interface{} // DeletePreAuthKeyOutputBody defines model for DeletePreAuthKeyOutputBody. type DeletePreAuthKeyOutputBody = map[string]interface{} // DeleteUserOutputBody defines model for DeleteUserOutputBody. type DeleteUserOutputBody = map[string]interface{} // ErrorDetail defines model for ErrorDetail. type ErrorDetail struct { // Location Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' Location *string `json:"location,omitempty"` // Message Error message text Message *string `json:"message,omitempty"` // Value The value at the given location Value interface{} `json:"value,omitempty"` } // ErrorModel defines model for ErrorModel. type ErrorModel struct { // Detail A human-readable explanation specific to this occurrence of the problem. // // Example: Property foo is required but is missing. Detail *string `json:"detail,omitempty"` // Errors Optional list of individual error details Errors *[]ErrorDetail `json:"errors,omitempty"` // Instance A URI reference that identifies the specific occurrence of the problem. // // Example: https://example.com/error-log/abc123 Instance *string `json:"instance,omitempty"` // Status HTTP status code // // Example: 400 Status *int64 `json:"status,omitempty"` // Title A short, human-readable summary of the problem type. This value should not change between occurrences of the error. // // Example: Bad Request Title *string `json:"title,omitempty"` // Type A URI reference to human-readable documentation for the error. // // Example: https://example.com/errors/example Type *string `json:"type,omitempty"` } // ExpireApiKeyOutputBody defines model for ExpireApiKeyOutputBody. type ExpireApiKeyOutputBody = map[string]interface{} // ExpireApiKeyRequestBody defines model for ExpireApiKeyRequestBody. type ExpireApiKeyRequestBody struct { Id *string `json:"id,omitempty"` Prefix *string `json:"prefix,omitempty"` } // ExpireNodeRequestBody defines model for ExpireNodeRequestBody. type ExpireNodeRequestBody struct { DisableExpiry *bool `json:"disableExpiry,omitempty"` Expiry *time.Time `json:"expiry,omitempty"` } // ExpirePreAuthKeyOutputBody defines model for ExpirePreAuthKeyOutputBody. type ExpirePreAuthKeyOutputBody = map[string]interface{} // ExpirePreAuthKeyRequestBody defines model for ExpirePreAuthKeyRequestBody. type ExpirePreAuthKeyRequestBody struct { Id *string `json:"id,omitempty"` } // HealthResponseBody defines model for HealthResponseBody. type HealthResponseBody struct { DatabaseConnectivity bool `json:"databaseConnectivity"` } // ListApiKeysOutputBody defines model for ListApiKeysOutputBody. type ListApiKeysOutputBody struct { ApiKeys []ApiKey `json:"apiKeys"` } // ListNodesOutputBody defines model for ListNodesOutputBody. type ListNodesOutputBody struct { Nodes []Node `json:"nodes"` } // ListPreAuthKeysOutputBody defines model for ListPreAuthKeysOutputBody. type ListPreAuthKeysOutputBody struct { PreAuthKeys []PreAuthKey `json:"preAuthKeys"` } // ListUsersOutputBody defines model for ListUsersOutputBody. type ListUsersOutputBody struct { Users []User `json:"users"` } // Node defines model for Node. type Node struct { ApprovedRoutes []string `json:"approvedRoutes"` AvailableRoutes []string `json:"availableRoutes"` CreatedAt time.Time `json:"createdAt"` DiscoKey string `json:"discoKey"` Expiry *time.Time `json:"expiry"` GivenName string `json:"givenName"` Id string `json:"id"` IpAddresses []string `json:"ipAddresses"` LastSeen *time.Time `json:"lastSeen"` MachineKey string `json:"machineKey"` Name string `json:"name"` NodeKey string `json:"nodeKey"` Online bool `json:"online"` PreAuthKey NodePreAuthKey `json:"preAuthKey"` RegisterMethod NodeRegisterMethod `json:"registerMethod"` SubnetRoutes []string `json:"subnetRoutes"` Tags []string `json:"tags"` User User `json:"user"` } // NodeRegisterMethod defines model for Node.RegisterMethod. type NodeRegisterMethod string // NodeOutputBody defines model for NodeOutputBody. type NodeOutputBody struct { Node Node `json:"node"` } // NodePreAuthKey defines model for NodePreAuthKey. type NodePreAuthKey struct { AclTags []string `json:"aclTags"` CreatedAt *time.Time `json:"createdAt"` Ephemeral bool `json:"ephemeral"` Expiration *time.Time `json:"expiration"` Id string `json:"id"` Key string `json:"key"` Reusable bool `json:"reusable"` Used bool `json:"used"` User User `json:"user"` } // PolicyRequestBody defines model for PolicyRequestBody. type PolicyRequestBody struct { Policy *string `json:"policy,omitempty"` } // PolicyResponseBody defines model for PolicyResponseBody. type PolicyResponseBody struct { Policy string `json:"policy"` UpdatedAt time.Time `json:"updatedAt"` } // PreAuthKey defines model for PreAuthKey. type PreAuthKey struct { AclTags []string `json:"aclTags"` CreatedAt time.Time `json:"createdAt"` Ephemeral bool `json:"ephemeral"` Expiration time.Time `json:"expiration"` Id string `json:"id"` Key string `json:"key"` Reusable bool `json:"reusable"` Used bool `json:"used"` User User `json:"user"` } // PreAuthKeyOutputBody defines model for PreAuthKeyOutputBody. type PreAuthKeyOutputBody struct { PreAuthKey PreAuthKey `json:"preAuthKey"` } // SetApprovedRoutesRequestBody defines model for SetApprovedRoutesRequestBody. type SetApprovedRoutesRequestBody struct { Routes *[]string `json:"routes,omitempty"` } // SetTagsRequestBody defines model for SetTagsRequestBody. type SetTagsRequestBody struct { Tags *[]string `json:"tags,omitempty"` } // User defines model for User. type User struct { CreatedAt time.Time `json:"createdAt"` DisplayName string `json:"displayName"` Email string `json:"email"` Id string `json:"id"` Name string `json:"name"` ProfilePicUrl string `json:"profilePicUrl"` Provider string `json:"provider"` ProviderId string `json:"providerId"` } // UserOutputBody defines model for UserOutputBody. type UserOutputBody struct { User User `json:"user"` } // DeleteApiKeyParams defines parameters for DeleteApiKey. type DeleteApiKeyParams struct { Id *string `form:"id,omitempty" json:"id,omitempty"` } // ListNodesParams defines parameters for ListNodes. type ListNodesParams struct { User *string `form:"user,omitempty" json:"user,omitempty"` } // BackfillNodeIPsParams defines parameters for BackfillNodeIPs. type BackfillNodeIPsParams struct { Confirmed *bool `form:"confirmed,omitempty" json:"confirmed,omitempty"` } // RegisterNodeParams defines parameters for RegisterNode. type RegisterNodeParams struct { User *string `form:"user,omitempty" json:"user,omitempty"` Key *string `form:"key,omitempty" json:"key,omitempty"` } // DeletePreAuthKeyParams defines parameters for DeletePreAuthKey. type DeletePreAuthKeyParams struct { Id *string `form:"id,omitempty" json:"id,omitempty"` } // ListUsersParams defines parameters for ListUsers. type ListUsersParams struct { Id *string `form:"id,omitempty" json:"id,omitempty"` Name *string `form:"name,omitempty" json:"name,omitempty"` Email *string `form:"email,omitempty" json:"email,omitempty"` } // CreateApiKeyJSONRequestBody defines body for CreateApiKey for application/json ContentType. type CreateApiKeyJSONRequestBody = CreateApiKeyRequestBody // ExpireApiKeyJSONRequestBody defines body for ExpireApiKey for application/json ContentType. type ExpireApiKeyJSONRequestBody = ExpireApiKeyRequestBody // AuthApproveJSONRequestBody defines body for AuthApprove for application/json ContentType. type AuthApproveJSONRequestBody = AuthApproveRequestBody // AuthRegisterJSONRequestBody defines body for AuthRegister for application/json ContentType. type AuthRegisterJSONRequestBody = AuthRegisterRequestBody // AuthRejectJSONRequestBody defines body for AuthReject for application/json ContentType. type AuthRejectJSONRequestBody = AuthRejectRequestBody // DebugCreateNodeJSONRequestBody defines body for DebugCreateNode for application/json ContentType. type DebugCreateNodeJSONRequestBody = DebugCreateNodeRequestBody // SetApprovedRoutesJSONRequestBody defines body for SetApprovedRoutes for application/json ContentType. type SetApprovedRoutesJSONRequestBody = SetApprovedRoutesRequestBody // ExpireNodeJSONRequestBody defines body for ExpireNode for application/json ContentType. type ExpireNodeJSONRequestBody = ExpireNodeRequestBody // SetTagsJSONRequestBody defines body for SetTags for application/json ContentType. type SetTagsJSONRequestBody = SetTagsRequestBody // SetPolicyJSONRequestBody defines body for SetPolicy for application/json ContentType. type SetPolicyJSONRequestBody = PolicyRequestBody // CheckPolicyJSONRequestBody defines body for CheckPolicy for application/json ContentType. type CheckPolicyJSONRequestBody = PolicyRequestBody // CreatePreAuthKeyJSONRequestBody defines body for CreatePreAuthKey for application/json ContentType. type CreatePreAuthKeyJSONRequestBody = CreatePreAuthKeyRequestBody // ExpirePreAuthKeyJSONRequestBody defines body for ExpirePreAuthKey for application/json ContentType. type ExpirePreAuthKeyJSONRequestBody = ExpirePreAuthKeyRequestBody // CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType. type CreateUserJSONRequestBody = CreateUserRequestBody // 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 { // ListApiKeys List API keys // // Corresponds with GET /api/v1/apikey (the `ListApiKeys` operationId). ListApiKeys(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateApiKeyWithBody Create API key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). CreateApiKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateApiKey Create API key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). CreateApiKey(ctx context.Context, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ExpireApiKeyWithBody Expire API key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). ExpireApiKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ExpireApiKey Expire API key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). ExpireApiKey(ctx context.Context, body ExpireApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteApiKey Delete API key // // Corresponds with DELETE /api/v1/apikey/{prefix} (the `DeleteApiKey` operationId). DeleteApiKey(ctx context.Context, prefix string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) // AuthApproveWithBody Approve a pending auth session // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). AuthApproveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // AuthApprove Approve a pending auth session // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). AuthApprove(ctx context.Context, body AuthApproveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // AuthRegisterWithBody Register node via auth flow // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). AuthRegisterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // AuthRegister Register node via auth flow // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). AuthRegister(ctx context.Context, body AuthRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // AuthRejectWithBody Reject a pending auth session // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). AuthRejectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // AuthReject Reject a pending auth session // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). AuthReject(ctx context.Context, body AuthRejectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DebugCreateNodeWithBody Debug create node // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). DebugCreateNodeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // DebugCreateNode Debug create node // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). DebugCreateNode(ctx context.Context, body DebugCreateNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // Health Health check // // Reports server health, including database connectivity. // // Corresponds with GET /api/v1/health (the `Health` operationId). Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // ListNodes List nodes // // Corresponds with GET /api/v1/node (the `ListNodes` operationId). ListNodes(ctx context.Context, params *ListNodesParams, reqEditors ...RequestEditorFn) (*http.Response, error) // BackfillNodeIPs Backfill node IPs // // Corresponds with POST /api/v1/node/backfillips (the `BackfillNodeIPs` operationId). BackfillNodeIPs(ctx context.Context, params *BackfillNodeIPsParams, reqEditors ...RequestEditorFn) (*http.Response, error) // RegisterNode Register node // // Corresponds with POST /api/v1/node/register (the `RegisterNode` operationId). RegisterNode(ctx context.Context, params *RegisterNodeParams, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteNode Delete node // // Corresponds with DELETE /api/v1/node/{nodeId} (the `DeleteNode` operationId). DeleteNode(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*http.Response, error) // GetNode Get node // // Corresponds with GET /api/v1/node/{nodeId} (the `GetNode` operationId). GetNode(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*http.Response, error) // SetApprovedRoutesWithBody Set approved routes // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). SetApprovedRoutesWithBody(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // SetApprovedRoutes Set approved routes // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). SetApprovedRoutes(ctx context.Context, nodeId string, body SetApprovedRoutesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ExpireNodeWithBody Expire node // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). ExpireNodeWithBody(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ExpireNode Expire node // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). ExpireNode(ctx context.Context, nodeId string, body ExpireNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // RenameNode Rename node // // Corresponds with POST /api/v1/node/{nodeId}/rename/{newName} (the `RenameNode` operationId). RenameNode(ctx context.Context, nodeId string, newName string, reqEditors ...RequestEditorFn) (*http.Response, error) // SetTagsWithBody Set tags // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). SetTagsWithBody(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // SetTags Set tags // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). SetTags(ctx context.Context, nodeId string, body SetTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetPolicy Get policy // // Corresponds with GET /api/v1/policy (the `GetPolicy` operationId). GetPolicy(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // SetPolicyWithBody Set policy // // Takes any type of body and a specified content type. // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). SetPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // SetPolicy Set policy // // Takes a body of the `application/json` content type. // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). SetPolicy(ctx context.Context, body SetPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // CheckPolicyWithBody Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). CheckPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CheckPolicy Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). CheckPolicy(ctx context.Context, body CheckPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeletePreAuthKey Delete pre-auth key // // Corresponds with DELETE /api/v1/preauthkey (the `DeletePreAuthKey` operationId). DeletePreAuthKey(ctx context.Context, params *DeletePreAuthKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) // ListPreAuthKeys List pre-auth keys // // Corresponds with GET /api/v1/preauthkey (the `ListPreAuthKeys` operationId). ListPreAuthKeys(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePreAuthKeyWithBody Create pre-auth key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). CreatePreAuthKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreatePreAuthKey Create pre-auth key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). CreatePreAuthKey(ctx context.Context, body CreatePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ExpirePreAuthKeyWithBody Expire pre-auth key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). ExpirePreAuthKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // ExpirePreAuthKey Expire pre-auth key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). ExpirePreAuthKey(ctx context.Context, body ExpirePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListUsers List users // // Corresponds with GET /api/v1/user (the `ListUsers` operationId). ListUsers(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateUserWithBody Create user // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). CreateUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) // CreateUser Create user // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). CreateUser(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // DeleteUser Delete user // // Corresponds with DELETE /api/v1/user/{id} (the `DeleteUser` operationId). DeleteUser(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) // RenameUser Rename user // // Corresponds with POST /api/v1/user/{oldId}/rename/{newName} (the `RenameUser` operationId). RenameUser(ctx context.Context, oldId string, newName string, reqEditors ...RequestEditorFn) (*http.Response, error) } // ListApiKeys List API keys // // Corresponds with GET /api/v1/apikey (the `ListApiKeys` operationId). func (c *Client) ListApiKeys(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListApiKeysRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateApiKeyWithBody Create API key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). func (c *Client) CreateApiKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateApiKeyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateApiKey Create API key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). func (c *Client) CreateApiKey(ctx context.Context, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateApiKeyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ExpireApiKeyWithBody Expire API key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). func (c *Client) ExpireApiKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExpireApiKeyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ExpireApiKey Expire API key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). func (c *Client) ExpireApiKey(ctx context.Context, body ExpireApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExpireApiKeyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteApiKey Delete API key // // Corresponds with DELETE /api/v1/apikey/{prefix} (the `DeleteApiKey` operationId). func (c *Client) DeleteApiKey(ctx context.Context, prefix string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteApiKeyRequest(c.Server, prefix, 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) } // AuthApproveWithBody Approve a pending auth session // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). func (c *Client) AuthApproveWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthApproveRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AuthApprove Approve a pending auth session // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). func (c *Client) AuthApprove(ctx context.Context, body AuthApproveJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthApproveRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AuthRegisterWithBody Register node via auth flow // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). func (c *Client) AuthRegisterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthRegisterRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AuthRegister Register node via auth flow // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). func (c *Client) AuthRegister(ctx context.Context, body AuthRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthRegisterRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AuthRejectWithBody Reject a pending auth session // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). func (c *Client) AuthRejectWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthRejectRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // AuthReject Reject a pending auth session // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). func (c *Client) AuthReject(ctx context.Context, body AuthRejectJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAuthRejectRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DebugCreateNodeWithBody Debug create node // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). func (c *Client) DebugCreateNodeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDebugCreateNodeRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DebugCreateNode Debug create node // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). func (c *Client) DebugCreateNode(ctx context.Context, body DebugCreateNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDebugCreateNodeRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // Health Health check // // Reports server health, including database connectivity. // // Corresponds with GET /api/v1/health (the `Health` operationId). func (c *Client) Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewHealthRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListNodes List nodes // // Corresponds with GET /api/v1/node (the `ListNodes` operationId). func (c *Client) ListNodes(ctx context.Context, params *ListNodesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListNodesRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // BackfillNodeIPs Backfill node IPs // // Corresponds with POST /api/v1/node/backfillips (the `BackfillNodeIPs` operationId). func (c *Client) BackfillNodeIPs(ctx context.Context, params *BackfillNodeIPsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewBackfillNodeIPsRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RegisterNode Register node // // Corresponds with POST /api/v1/node/register (the `RegisterNode` operationId). func (c *Client) RegisterNode(ctx context.Context, params *RegisterNodeParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRegisterNodeRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteNode Delete node // // Corresponds with DELETE /api/v1/node/{nodeId} (the `DeleteNode` operationId). func (c *Client) DeleteNode(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteNodeRequest(c.Server, nodeId) 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) } // GetNode Get node // // Corresponds with GET /api/v1/node/{nodeId} (the `GetNode` operationId). func (c *Client) GetNode(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetNodeRequest(c.Server, nodeId) 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) } // SetApprovedRoutesWithBody Set approved routes // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). func (c *Client) SetApprovedRoutesWithBody(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSetApprovedRoutesRequestWithBody(c.Server, nodeId, 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) } // SetApprovedRoutes Set approved routes // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). func (c *Client) SetApprovedRoutes(ctx context.Context, nodeId string, body SetApprovedRoutesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSetApprovedRoutesRequest(c.Server, nodeId, 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) } // ExpireNodeWithBody Expire node // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). func (c *Client) ExpireNodeWithBody(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExpireNodeRequestWithBody(c.Server, nodeId, 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) } // ExpireNode Expire node // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). func (c *Client) ExpireNode(ctx context.Context, nodeId string, body ExpireNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExpireNodeRequest(c.Server, nodeId, 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) } // RenameNode Rename node // // Corresponds with POST /api/v1/node/{nodeId}/rename/{newName} (the `RenameNode` operationId). func (c *Client) RenameNode(ctx context.Context, nodeId string, newName string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRenameNodeRequest(c.Server, nodeId, newName) 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) } // SetTagsWithBody Set tags // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). func (c *Client) SetTagsWithBody(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSetTagsRequestWithBody(c.Server, nodeId, 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) } // SetTags Set tags // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). func (c *Client) SetTags(ctx context.Context, nodeId string, body SetTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSetTagsRequest(c.Server, nodeId, 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) } // GetPolicy Get policy // // Corresponds with GET /api/v1/policy (the `GetPolicy` operationId). func (c *Client) GetPolicy(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetPolicyRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // SetPolicyWithBody Set policy // // Takes any type of body and a specified content type. // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). func (c *Client) SetPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSetPolicyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // SetPolicy Set policy // // Takes a body of the `application/json` content type. // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). func (c *Client) SetPolicy(ctx context.Context, body SetPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewSetPolicyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CheckPolicyWithBody Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). func (c *Client) CheckPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCheckPolicyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CheckPolicy Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). func (c *Client) CheckPolicy(ctx context.Context, body CheckPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCheckPolicyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeletePreAuthKey Delete pre-auth key // // Corresponds with DELETE /api/v1/preauthkey (the `DeletePreAuthKey` operationId). func (c *Client) DeletePreAuthKey(ctx context.Context, params *DeletePreAuthKeyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeletePreAuthKeyRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListPreAuthKeys List pre-auth keys // // Corresponds with GET /api/v1/preauthkey (the `ListPreAuthKeys` operationId). func (c *Client) ListPreAuthKeys(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListPreAuthKeysRequest(c.Server) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreatePreAuthKeyWithBody Create pre-auth key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). func (c *Client) CreatePreAuthKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePreAuthKeyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreatePreAuthKey Create pre-auth key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). func (c *Client) CreatePreAuthKey(ctx context.Context, body CreatePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreatePreAuthKeyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ExpirePreAuthKeyWithBody Expire pre-auth key // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). func (c *Client) ExpirePreAuthKeyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExpirePreAuthKeyRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ExpirePreAuthKey Expire pre-auth key // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). func (c *Client) ExpirePreAuthKey(ctx context.Context, body ExpirePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExpirePreAuthKeyRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // ListUsers List users // // Corresponds with GET /api/v1/user (the `ListUsers` operationId). func (c *Client) ListUsers(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListUsersRequest(c.Server, params) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateUserWithBody Create user // // Takes any type of body and a specified content type. // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). func (c *Client) CreateUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateUserRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // CreateUser Create user // // Takes a body of the `application/json` content type. // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). func (c *Client) CreateUser(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewCreateUserRequest(c.Server, body) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // DeleteUser Delete user // // Corresponds with DELETE /api/v1/user/{id} (the `DeleteUser` operationId). func (c *Client) DeleteUser(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteUserRequest(c.Server, id) if err != nil { return nil, err } req = req.WithContext(ctx) if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } return c.Client.Do(req) } // RenameUser Rename user // // Corresponds with POST /api/v1/user/{oldId}/rename/{newName} (the `RenameUser` operationId). func (c *Client) RenameUser(ctx context.Context, oldId string, newName string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewRenameUserRequest(c.Server, oldId, newName) 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) } // NewListApiKeysRequest constructs an http.Request for the ListApiKeys method func NewListApiKeysRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/apikey") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateApiKeyRequest calls the generic CreateApiKey builder with application/json body func NewCreateApiKeyRequest(server string, body CreateApiKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateApiKeyRequestWithBody(server, "application/json", bodyReader) } // NewCreateApiKeyRequestWithBody constructs an http.Request for the CreateApiKey method, with any body, and a specified content type func NewCreateApiKeyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/apikey") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewExpireApiKeyRequest calls the generic ExpireApiKey builder with application/json body func NewExpireApiKeyRequest(server string, body ExpireApiKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewExpireApiKeyRequestWithBody(server, "application/json", bodyReader) } // NewExpireApiKeyRequestWithBody constructs an http.Request for the ExpireApiKey method, with any body, and a specified content type func NewExpireApiKeyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/apikey/expire") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteApiKeyRequest constructs an http.Request for the DeleteApiKey method func NewDeleteApiKeyRequest(server string, prefix string, params *DeleteApiKeyParams) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "prefix", prefix, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/apikey/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Id != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "id", *params.Id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewAuthApproveRequest calls the generic AuthApprove builder with application/json body func NewAuthApproveRequest(server string, body AuthApproveJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewAuthApproveRequestWithBody(server, "application/json", bodyReader) } // NewAuthApproveRequestWithBody constructs an http.Request for the AuthApprove method, with any body, and a specified content type func NewAuthApproveRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/auth/approve") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewAuthRegisterRequest calls the generic AuthRegister builder with application/json body func NewAuthRegisterRequest(server string, body AuthRegisterJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewAuthRegisterRequestWithBody(server, "application/json", bodyReader) } // NewAuthRegisterRequestWithBody constructs an http.Request for the AuthRegister method, with any body, and a specified content type func NewAuthRegisterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/auth/register") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewAuthRejectRequest calls the generic AuthReject builder with application/json body func NewAuthRejectRequest(server string, body AuthRejectJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewAuthRejectRequestWithBody(server, "application/json", bodyReader) } // NewAuthRejectRequestWithBody constructs an http.Request for the AuthReject method, with any body, and a specified content type func NewAuthRejectRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/auth/reject") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDebugCreateNodeRequest calls the generic DebugCreateNode builder with application/json body func NewDebugCreateNodeRequest(server string, body DebugCreateNodeJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewDebugCreateNodeRequestWithBody(server, "application/json", bodyReader) } // NewDebugCreateNodeRequestWithBody constructs an http.Request for the DebugCreateNode method, with any body, and a specified content type func NewDebugCreateNodeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/debug/node") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewHealthRequest constructs an http.Request for the Health method func NewHealthRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/health") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListNodesRequest constructs an http.Request for the ListNodes method func NewListNodesRequest(server string, params *ListNodesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.User != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "user", *params.User, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewBackfillNodeIPsRequest constructs an http.Request for the BackfillNodeIPs method func NewBackfillNodeIPsRequest(server string, params *BackfillNodeIPsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/backfillips") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Confirmed != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "confirmed", *params.Confirmed, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewRegisterNodeRequest constructs an http.Request for the RegisterNode method func NewRegisterNodeRequest(server string, params *RegisterNodeParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/register") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.User != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "user", *params.User, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Key != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "key", *params.Key, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewDeleteNodeRequest constructs an http.Request for the DeleteNode method func NewDeleteNodeRequest(server string, nodeId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "nodeId", nodeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewGetNodeRequest constructs an http.Request for the GetNode method func NewGetNodeRequest(server string, nodeId string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "nodeId", nodeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewSetApprovedRoutesRequest calls the generic SetApprovedRoutes builder with application/json body func NewSetApprovedRoutesRequest(server string, nodeId string, body SetApprovedRoutesJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewSetApprovedRoutesRequestWithBody(server, nodeId, "application/json", bodyReader) } // NewSetApprovedRoutesRequestWithBody constructs an http.Request for the SetApprovedRoutes method, with any body, and a specified content type func NewSetApprovedRoutesRequestWithBody(server string, nodeId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "nodeId", nodeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/%s/approve_routes", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewExpireNodeRequest calls the generic ExpireNode builder with application/json body func NewExpireNodeRequest(server string, nodeId string, body ExpireNodeJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewExpireNodeRequestWithBody(server, nodeId, "application/json", bodyReader) } // NewExpireNodeRequestWithBody constructs an http.Request for the ExpireNode method, with any body, and a specified content type func NewExpireNodeRequestWithBody(server string, nodeId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "nodeId", nodeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/%s/expire", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewRenameNodeRequest constructs an http.Request for the RenameNode method func NewRenameNodeRequest(server string, nodeId string, newName string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "nodeId", nodeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "newName", newName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/%s/rename/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewSetTagsRequest calls the generic SetTags builder with application/json body func NewSetTagsRequest(server string, nodeId string, body SetTagsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewSetTagsRequestWithBody(server, nodeId, "application/json", bodyReader) } // NewSetTagsRequestWithBody constructs an http.Request for the SetTags method, with any body, and a specified content type func NewSetTagsRequestWithBody(server string, nodeId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "nodeId", nodeId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/node/%s/tags", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewGetPolicyRequest constructs an http.Request for the GetPolicy method func NewGetPolicyRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/policy") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewSetPolicyRequest calls the generic SetPolicy builder with application/json body func NewSetPolicyRequest(server string, body SetPolicyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewSetPolicyRequestWithBody(server, "application/json", bodyReader) } // NewSetPolicyRequestWithBody constructs an http.Request for the SetPolicy method, with any body, and a specified content type func NewSetPolicyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/policy") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewCheckPolicyRequest calls the generic CheckPolicy builder with application/json body func NewCheckPolicyRequest(server string, body CheckPolicyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCheckPolicyRequestWithBody(server, "application/json", bodyReader) } // NewCheckPolicyRequestWithBody constructs an http.Request for the CheckPolicy method, with any body, and a specified content type func NewCheckPolicyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/policy/check") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeletePreAuthKeyRequest constructs an http.Request for the DeletePreAuthKey method func NewDeletePreAuthKeyRequest(server string, params *DeletePreAuthKeyParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/preauthkey") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Id != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "id", *params.Id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewListPreAuthKeysRequest constructs an http.Request for the ListPreAuthKeys method func NewListPreAuthKeysRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/preauthkey") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreatePreAuthKeyRequest calls the generic CreatePreAuthKey builder with application/json body func NewCreatePreAuthKeyRequest(server string, body CreatePreAuthKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreatePreAuthKeyRequestWithBody(server, "application/json", bodyReader) } // NewCreatePreAuthKeyRequestWithBody constructs an http.Request for the CreatePreAuthKey method, with any body, and a specified content type func NewCreatePreAuthKeyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/preauthkey") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewExpirePreAuthKeyRequest calls the generic ExpirePreAuthKey builder with application/json body func NewExpirePreAuthKeyRequest(server string, body ExpirePreAuthKeyJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewExpirePreAuthKeyRequestWithBody(server, "application/json", bodyReader) } // NewExpirePreAuthKeyRequestWithBody constructs an http.Request for the ExpirePreAuthKey method, with any body, and a specified content type func NewExpirePreAuthKeyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/preauthkey/expire") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewListUsersRequest constructs an http.Request for the ListUsers method func NewListUsersRequest(server string, params *ListUsersParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/user") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } if params != nil { // queryValues collects non-styled parameters (passthrough, JSON) // that are safe to round-trip through url.Values.Encode(). queryValues := queryURL.Query() // rawQueryFragments collects pre-encoded query fragments from // styled parameters, preserving literal commas as delimiters // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string if params.Id != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "id", *params.Id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uint64"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Name != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "name", *params.Name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if params.Email != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", false, "email", *params.Email, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { rawQueryFragments = append(rawQueryFragments, qp) } } } if encoded := queryValues.Encode(); encoded != "" { rawQueryFragments = append(rawQueryFragments, encoded) } queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewCreateUserRequest calls the generic CreateUser builder with application/json body func NewCreateUserRequest(server string, body CreateUserJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) return NewCreateUserRequestWithBody(server, "application/json", bodyReader) } // NewCreateUserRequestWithBody constructs an http.Request for the CreateUser method, with any body, and a specified content type func NewCreateUserRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/user") if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } req.Header.Add("Content-Type", contentType) return req, nil } // NewDeleteUserRequest constructs an http.Request for the DeleteUser method func NewDeleteUserRequest(server string, id string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/user/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } return req, nil } // NewRenameUserRequest constructs an http.Request for the RenameUser method func NewRenameUserRequest(server string, oldId string, newName string) (*http.Request, error) { var err error var pathParam0 string pathParam0, err = runtime.StyleParamWithOptions("simple", false, "oldId", oldId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uint64"}) if err != nil { return nil, err } var pathParam1 string pathParam1, err = runtime.StyleParamWithOptions("simple", false, "newName", newName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) if err != nil { return nil, err } serverURL, err := url.Parse(server) if err != nil { return nil, err } operationPath := fmt.Sprintf("/api/v1/user/%s/rename/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } queryURL, err := serverURL.Parse(operationPath) if err != nil { return nil, err } req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } 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 { // ListApiKeysWithResponse List API keys // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/apikey (the `ListApiKeys` operationId). ListApiKeysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListApiKeysResponse, error) // CreateApiKeyWithBodyWithResponse Create API key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). CreateApiKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) // CreateApiKeyWithResponse Create API key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). CreateApiKeyWithResponse(ctx context.Context, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) // ExpireApiKeyWithBodyWithResponse Expire API key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). ExpireApiKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExpireApiKeyResponse, error) // ExpireApiKeyWithResponse Expire API key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). ExpireApiKeyWithResponse(ctx context.Context, body ExpireApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*ExpireApiKeyResponse, error) // DeleteApiKeyWithResponse Delete API key // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/apikey/{prefix} (the `DeleteApiKey` operationId). DeleteApiKeyWithResponse(ctx context.Context, prefix string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) // AuthApproveWithBodyWithResponse Approve a pending auth session // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). AuthApproveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthApproveResponse, error) // AuthApproveWithResponse Approve a pending auth session // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). AuthApproveWithResponse(ctx context.Context, body AuthApproveJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthApproveResponse, error) // AuthRegisterWithBodyWithResponse Register node via auth flow // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). AuthRegisterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthRegisterResponse, error) // AuthRegisterWithResponse Register node via auth flow // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). AuthRegisterWithResponse(ctx context.Context, body AuthRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthRegisterResponse, error) // AuthRejectWithBodyWithResponse Reject a pending auth session // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). AuthRejectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthRejectResponse, error) // AuthRejectWithResponse Reject a pending auth session // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). AuthRejectWithResponse(ctx context.Context, body AuthRejectJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthRejectResponse, error) // DebugCreateNodeWithBodyWithResponse Debug create node // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). DebugCreateNodeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DebugCreateNodeResponse, error) // DebugCreateNodeWithResponse Debug create node // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). DebugCreateNodeWithResponse(ctx context.Context, body DebugCreateNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*DebugCreateNodeResponse, error) // HealthWithResponse Health check // // Reports server health, including database connectivity. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/health (the `Health` operationId). HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error) // ListNodesWithResponse List nodes // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/node (the `ListNodes` operationId). ListNodesWithResponse(ctx context.Context, params *ListNodesParams, reqEditors ...RequestEditorFn) (*ListNodesResponse, error) // BackfillNodeIPsWithResponse Backfill node IPs // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/backfillips (the `BackfillNodeIPs` operationId). BackfillNodeIPsWithResponse(ctx context.Context, params *BackfillNodeIPsParams, reqEditors ...RequestEditorFn) (*BackfillNodeIPsResponse, error) // RegisterNodeWithResponse Register node // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/register (the `RegisterNode` operationId). RegisterNodeWithResponse(ctx context.Context, params *RegisterNodeParams, reqEditors ...RequestEditorFn) (*RegisterNodeResponse, error) // DeleteNodeWithResponse Delete node // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/node/{nodeId} (the `DeleteNode` operationId). DeleteNodeWithResponse(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*DeleteNodeResponse, error) // GetNodeWithResponse Get node // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/node/{nodeId} (the `GetNode` operationId). GetNodeWithResponse(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*GetNodeResponse, error) // SetApprovedRoutesWithBodyWithResponse Set approved routes // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). SetApprovedRoutesWithBodyWithResponse(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetApprovedRoutesResponse, error) // SetApprovedRoutesWithResponse Set approved routes // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). SetApprovedRoutesWithResponse(ctx context.Context, nodeId string, body SetApprovedRoutesJSONRequestBody, reqEditors ...RequestEditorFn) (*SetApprovedRoutesResponse, error) // ExpireNodeWithBodyWithResponse Expire node // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). ExpireNodeWithBodyWithResponse(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExpireNodeResponse, error) // ExpireNodeWithResponse Expire node // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). ExpireNodeWithResponse(ctx context.Context, nodeId string, body ExpireNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*ExpireNodeResponse, error) // RenameNodeWithResponse Rename node // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/rename/{newName} (the `RenameNode` operationId). RenameNodeWithResponse(ctx context.Context, nodeId string, newName string, reqEditors ...RequestEditorFn) (*RenameNodeResponse, error) // SetTagsWithBodyWithResponse Set tags // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). SetTagsWithBodyWithResponse(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetTagsResponse, error) // SetTagsWithResponse Set tags // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). SetTagsWithResponse(ctx context.Context, nodeId string, body SetTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetTagsResponse, error) // GetPolicyWithResponse Get policy // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/policy (the `GetPolicy` operationId). GetPolicyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPolicyResponse, error) // SetPolicyWithBodyWithResponse Set policy // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). SetPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetPolicyResponse, error) // SetPolicyWithResponse Set policy // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). SetPolicyWithResponse(ctx context.Context, body SetPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*SetPolicyResponse, error) // CheckPolicyWithBodyWithResponse Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). CheckPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CheckPolicyResponse, error) // CheckPolicyWithResponse Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). CheckPolicyWithResponse(ctx context.Context, body CheckPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CheckPolicyResponse, error) // DeletePreAuthKeyWithResponse Delete pre-auth key // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/preauthkey (the `DeletePreAuthKey` operationId). DeletePreAuthKeyWithResponse(ctx context.Context, params *DeletePreAuthKeyParams, reqEditors ...RequestEditorFn) (*DeletePreAuthKeyResponse, error) // ListPreAuthKeysWithResponse List pre-auth keys // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/preauthkey (the `ListPreAuthKeys` operationId). ListPreAuthKeysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListPreAuthKeysResponse, error) // CreatePreAuthKeyWithBodyWithResponse Create pre-auth key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). CreatePreAuthKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePreAuthKeyResponse, error) // CreatePreAuthKeyWithResponse Create pre-auth key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). CreatePreAuthKeyWithResponse(ctx context.Context, body CreatePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePreAuthKeyResponse, error) // ExpirePreAuthKeyWithBodyWithResponse Expire pre-auth key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). ExpirePreAuthKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExpirePreAuthKeyResponse, error) // ExpirePreAuthKeyWithResponse Expire pre-auth key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). ExpirePreAuthKeyWithResponse(ctx context.Context, body ExpirePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*ExpirePreAuthKeyResponse, error) // ListUsersWithResponse List users // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/user (the `ListUsers` operationId). ListUsersWithResponse(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*ListUsersResponse, error) // CreateUserWithBodyWithResponse Create user // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). CreateUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) // CreateUserWithResponse Create user // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). CreateUserWithResponse(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) // DeleteUserWithResponse Delete user // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/user/{id} (the `DeleteUser` operationId). DeleteUserWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error) // RenameUserWithResponse Rename user // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/user/{oldId}/rename/{newName} (the `RenameUser` operationId). RenameUserWithResponse(ctx context.Context, oldId string, newName string, reqEditors ...RequestEditorFn) (*RenameUserResponse, error) } type ListApiKeysResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *ListApiKeysOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListApiKeysResponse) GetJSON200() *ListApiKeysOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ListApiKeysResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ListApiKeysResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r ListApiKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListApiKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ListApiKeysResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type CreateApiKeyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *CreateApiKeyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CreateApiKeyResponse) GetJSON200() *CreateApiKeyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r CreateApiKeyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r CreateApiKeyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r CreateApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r CreateApiKeyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type ExpireApiKeyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *ExpireApiKeyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ExpireApiKeyResponse) GetJSON200() *ExpireApiKeyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ExpireApiKeyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ExpireApiKeyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r ExpireApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ExpireApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ExpireApiKeyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DeleteApiKeyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *DeleteApiKeyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DeleteApiKeyResponse) GetJSON200() *DeleteApiKeyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r DeleteApiKeyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r DeleteApiKeyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DeleteApiKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteApiKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DeleteApiKeyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type AuthApproveResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *AuthApproveOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r AuthApproveResponse) GetJSON200() *AuthApproveOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r AuthApproveResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r AuthApproveResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r AuthApproveResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r AuthApproveResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r AuthApproveResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type AuthRegisterResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *AuthRegisterOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r AuthRegisterResponse) GetJSON200() *AuthRegisterOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r AuthRegisterResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r AuthRegisterResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r AuthRegisterResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r AuthRegisterResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r AuthRegisterResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type AuthRejectResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *AuthRejectOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r AuthRejectResponse) GetJSON200() *AuthRejectOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r AuthRejectResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r AuthRejectResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r AuthRejectResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r AuthRejectResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r AuthRejectResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DebugCreateNodeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DebugCreateNodeResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r DebugCreateNodeResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r DebugCreateNodeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DebugCreateNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DebugCreateNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DebugCreateNodeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type HealthResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *HealthResponseBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r HealthResponse) GetJSON200() *HealthResponseBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r HealthResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r HealthResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r HealthResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r HealthResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r HealthResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type ListNodesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *ListNodesOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListNodesResponse) GetJSON200() *ListNodesOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ListNodesResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ListNodesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r ListNodesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListNodesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ListNodesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type BackfillNodeIPsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *BackfillNodeIPsOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r BackfillNodeIPsResponse) GetJSON200() *BackfillNodeIPsOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r BackfillNodeIPsResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r BackfillNodeIPsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r BackfillNodeIPsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r BackfillNodeIPsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r BackfillNodeIPsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type RegisterNodeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r RegisterNodeResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r RegisterNodeResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r RegisterNodeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r RegisterNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r RegisterNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r RegisterNodeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DeleteNodeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *DeleteNodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DeleteNodeResponse) GetJSON200() *DeleteNodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r DeleteNodeResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r DeleteNodeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DeleteNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DeleteNodeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetNodeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetNodeResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r GetNodeResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r GetNodeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetNodeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type SetApprovedRoutesResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r SetApprovedRoutesResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r SetApprovedRoutesResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r SetApprovedRoutesResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r SetApprovedRoutesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r SetApprovedRoutesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r SetApprovedRoutesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type ExpireNodeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ExpireNodeResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ExpireNodeResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ExpireNodeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r ExpireNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ExpireNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ExpireNodeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type RenameNodeResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r RenameNodeResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r RenameNodeResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r RenameNodeResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r RenameNodeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r RenameNodeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r RenameNodeResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type SetTagsResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *NodeOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r SetTagsResponse) GetJSON200() *NodeOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r SetTagsResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r SetTagsResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r SetTagsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r SetTagsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r SetTagsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type GetPolicyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *PolicyResponseBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r GetPolicyResponse) GetJSON200() *PolicyResponseBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r GetPolicyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r GetPolicyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r GetPolicyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r GetPolicyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r GetPolicyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type SetPolicyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *PolicyResponseBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r SetPolicyResponse) GetJSON200() *PolicyResponseBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r SetPolicyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r SetPolicyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r SetPolicyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r SetPolicyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r SetPolicyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type CheckPolicyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *CheckPolicyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CheckPolicyResponse) GetJSON200() *CheckPolicyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r CheckPolicyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r CheckPolicyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r CheckPolicyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CheckPolicyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r CheckPolicyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DeletePreAuthKeyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *DeletePreAuthKeyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DeletePreAuthKeyResponse) GetJSON200() *DeletePreAuthKeyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r DeletePreAuthKeyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r DeletePreAuthKeyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DeletePreAuthKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeletePreAuthKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DeletePreAuthKeyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type ListPreAuthKeysResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *ListPreAuthKeysOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListPreAuthKeysResponse) GetJSON200() *ListPreAuthKeysOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ListPreAuthKeysResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ListPreAuthKeysResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r ListPreAuthKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ListPreAuthKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ListPreAuthKeysResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type CreatePreAuthKeyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *PreAuthKeyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CreatePreAuthKeyResponse) GetJSON200() *PreAuthKeyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r CreatePreAuthKeyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r CreatePreAuthKeyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r CreatePreAuthKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreatePreAuthKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r CreatePreAuthKeyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type ExpirePreAuthKeyResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *ExpirePreAuthKeyOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ExpirePreAuthKeyResponse) GetJSON200() *ExpirePreAuthKeyOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ExpirePreAuthKeyResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ExpirePreAuthKeyResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r ExpirePreAuthKeyResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r ExpirePreAuthKeyResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ExpirePreAuthKeyResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type ListUsersResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *ListUsersOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r ListUsersResponse) GetJSON200() *ListUsersOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r ListUsersResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r ListUsersResponse) GetBody() []byte { return r.Body } // 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 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r ListUsersResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type CreateUserResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *UserOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r CreateUserResponse) GetJSON200() *UserOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r CreateUserResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r CreateUserResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r CreateUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r CreateUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r CreateUserResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type DeleteUserResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *DeleteUserOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r DeleteUserResponse) GetJSON200() *DeleteUserOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r DeleteUserResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r DeleteUserResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r DeleteUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r DeleteUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r DeleteUserResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } type RenameUserResponse struct { Body []byte HTTPResponse *http.Response // JSON200 the response for an HTTP 200 `application/json` response JSON200 *UserOutputBody // ApplicationproblemJSONDefault the response for an HTTP default `application/problem+json` response ApplicationproblemJSONDefault *ErrorModel } // GetJSON200 returns the response for an HTTP 200 `application/json` response func (r RenameUserResponse) GetJSON200() *UserOutputBody { return r.JSON200 } // GetApplicationproblemJSONDefault returns the response for an HTTP default `application/problem+json` response func (r RenameUserResponse) GetApplicationproblemJSONDefault() *ErrorModel { return r.ApplicationproblemJSONDefault } // GetBody returns the raw response body bytes func (r RenameUserResponse) GetBody() []byte { return r.Body } // Status returns HTTPResponse.Status func (r RenameUserResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } return http.StatusText(0) } // StatusCode returns HTTPResponse.StatusCode func (r RenameUserResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers func (r RenameUserResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } // ListApiKeysWithResponse List API keys // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/apikey (the `ListApiKeys` operationId). func (c *ClientWithResponses) ListApiKeysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListApiKeysResponse, error) { rsp, err := c.ListApiKeys(ctx, reqEditors...) if err != nil { return nil, err } return ParseListApiKeysResponse(rsp) } // CreateApiKeyWithBodyWithResponse Create API key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). func (c *ClientWithResponses) CreateApiKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) { rsp, err := c.CreateApiKeyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateApiKeyResponse(rsp) } // CreateApiKeyWithResponse Create API key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey (the `CreateApiKey` operationId). func (c *ClientWithResponses) CreateApiKeyWithResponse(ctx context.Context, body CreateApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateApiKeyResponse, error) { rsp, err := c.CreateApiKey(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateApiKeyResponse(rsp) } // ExpireApiKeyWithBodyWithResponse Expire API key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). func (c *ClientWithResponses) ExpireApiKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExpireApiKeyResponse, error) { rsp, err := c.ExpireApiKeyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseExpireApiKeyResponse(rsp) } // ExpireApiKeyWithResponse Expire API key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/apikey/expire (the `ExpireApiKey` operationId). func (c *ClientWithResponses) ExpireApiKeyWithResponse(ctx context.Context, body ExpireApiKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*ExpireApiKeyResponse, error) { rsp, err := c.ExpireApiKey(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseExpireApiKeyResponse(rsp) } // DeleteApiKeyWithResponse Delete API key // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/apikey/{prefix} (the `DeleteApiKey` operationId). func (c *ClientWithResponses) DeleteApiKeyWithResponse(ctx context.Context, prefix string, params *DeleteApiKeyParams, reqEditors ...RequestEditorFn) (*DeleteApiKeyResponse, error) { rsp, err := c.DeleteApiKey(ctx, prefix, params, reqEditors...) if err != nil { return nil, err } return ParseDeleteApiKeyResponse(rsp) } // AuthApproveWithBodyWithResponse Approve a pending auth session // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). func (c *ClientWithResponses) AuthApproveWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthApproveResponse, error) { rsp, err := c.AuthApproveWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseAuthApproveResponse(rsp) } // AuthApproveWithResponse Approve a pending auth session // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/approve (the `AuthApprove` operationId). func (c *ClientWithResponses) AuthApproveWithResponse(ctx context.Context, body AuthApproveJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthApproveResponse, error) { rsp, err := c.AuthApprove(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseAuthApproveResponse(rsp) } // AuthRegisterWithBodyWithResponse Register node via auth flow // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). func (c *ClientWithResponses) AuthRegisterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthRegisterResponse, error) { rsp, err := c.AuthRegisterWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseAuthRegisterResponse(rsp) } // AuthRegisterWithResponse Register node via auth flow // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/register (the `AuthRegister` operationId). func (c *ClientWithResponses) AuthRegisterWithResponse(ctx context.Context, body AuthRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthRegisterResponse, error) { rsp, err := c.AuthRegister(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseAuthRegisterResponse(rsp) } // AuthRejectWithBodyWithResponse Reject a pending auth session // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). func (c *ClientWithResponses) AuthRejectWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AuthRejectResponse, error) { rsp, err := c.AuthRejectWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseAuthRejectResponse(rsp) } // AuthRejectWithResponse Reject a pending auth session // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/auth/reject (the `AuthReject` operationId). func (c *ClientWithResponses) AuthRejectWithResponse(ctx context.Context, body AuthRejectJSONRequestBody, reqEditors ...RequestEditorFn) (*AuthRejectResponse, error) { rsp, err := c.AuthReject(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseAuthRejectResponse(rsp) } // DebugCreateNodeWithBodyWithResponse Debug create node // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). func (c *ClientWithResponses) DebugCreateNodeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DebugCreateNodeResponse, error) { rsp, err := c.DebugCreateNodeWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseDebugCreateNodeResponse(rsp) } // DebugCreateNodeWithResponse Debug create node // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/debug/node (the `DebugCreateNode` operationId). func (c *ClientWithResponses) DebugCreateNodeWithResponse(ctx context.Context, body DebugCreateNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*DebugCreateNodeResponse, error) { rsp, err := c.DebugCreateNode(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseDebugCreateNodeResponse(rsp) } // HealthWithResponse Health check // // Reports server health, including database connectivity. // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/health (the `Health` operationId). func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error) { rsp, err := c.Health(ctx, reqEditors...) if err != nil { return nil, err } return ParseHealthResponse(rsp) } // ListNodesWithResponse List nodes // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/node (the `ListNodes` operationId). func (c *ClientWithResponses) ListNodesWithResponse(ctx context.Context, params *ListNodesParams, reqEditors ...RequestEditorFn) (*ListNodesResponse, error) { rsp, err := c.ListNodes(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListNodesResponse(rsp) } // BackfillNodeIPsWithResponse Backfill node IPs // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/backfillips (the `BackfillNodeIPs` operationId). func (c *ClientWithResponses) BackfillNodeIPsWithResponse(ctx context.Context, params *BackfillNodeIPsParams, reqEditors ...RequestEditorFn) (*BackfillNodeIPsResponse, error) { rsp, err := c.BackfillNodeIPs(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseBackfillNodeIPsResponse(rsp) } // RegisterNodeWithResponse Register node // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/register (the `RegisterNode` operationId). func (c *ClientWithResponses) RegisterNodeWithResponse(ctx context.Context, params *RegisterNodeParams, reqEditors ...RequestEditorFn) (*RegisterNodeResponse, error) { rsp, err := c.RegisterNode(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseRegisterNodeResponse(rsp) } // DeleteNodeWithResponse Delete node // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/node/{nodeId} (the `DeleteNode` operationId). func (c *ClientWithResponses) DeleteNodeWithResponse(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*DeleteNodeResponse, error) { rsp, err := c.DeleteNode(ctx, nodeId, reqEditors...) if err != nil { return nil, err } return ParseDeleteNodeResponse(rsp) } // GetNodeWithResponse Get node // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/node/{nodeId} (the `GetNode` operationId). func (c *ClientWithResponses) GetNodeWithResponse(ctx context.Context, nodeId string, reqEditors ...RequestEditorFn) (*GetNodeResponse, error) { rsp, err := c.GetNode(ctx, nodeId, reqEditors...) if err != nil { return nil, err } return ParseGetNodeResponse(rsp) } // SetApprovedRoutesWithBodyWithResponse Set approved routes // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). func (c *ClientWithResponses) SetApprovedRoutesWithBodyWithResponse(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetApprovedRoutesResponse, error) { rsp, err := c.SetApprovedRoutesWithBody(ctx, nodeId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseSetApprovedRoutesResponse(rsp) } // SetApprovedRoutesWithResponse Set approved routes // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/approve_routes (the `SetApprovedRoutes` operationId). func (c *ClientWithResponses) SetApprovedRoutesWithResponse(ctx context.Context, nodeId string, body SetApprovedRoutesJSONRequestBody, reqEditors ...RequestEditorFn) (*SetApprovedRoutesResponse, error) { rsp, err := c.SetApprovedRoutes(ctx, nodeId, body, reqEditors...) if err != nil { return nil, err } return ParseSetApprovedRoutesResponse(rsp) } // ExpireNodeWithBodyWithResponse Expire node // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). func (c *ClientWithResponses) ExpireNodeWithBodyWithResponse(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExpireNodeResponse, error) { rsp, err := c.ExpireNodeWithBody(ctx, nodeId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseExpireNodeResponse(rsp) } // ExpireNodeWithResponse Expire node // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/expire (the `ExpireNode` operationId). func (c *ClientWithResponses) ExpireNodeWithResponse(ctx context.Context, nodeId string, body ExpireNodeJSONRequestBody, reqEditors ...RequestEditorFn) (*ExpireNodeResponse, error) { rsp, err := c.ExpireNode(ctx, nodeId, body, reqEditors...) if err != nil { return nil, err } return ParseExpireNodeResponse(rsp) } // RenameNodeWithResponse Rename node // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/rename/{newName} (the `RenameNode` operationId). func (c *ClientWithResponses) RenameNodeWithResponse(ctx context.Context, nodeId string, newName string, reqEditors ...RequestEditorFn) (*RenameNodeResponse, error) { rsp, err := c.RenameNode(ctx, nodeId, newName, reqEditors...) if err != nil { return nil, err } return ParseRenameNodeResponse(rsp) } // SetTagsWithBodyWithResponse Set tags // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). func (c *ClientWithResponses) SetTagsWithBodyWithResponse(ctx context.Context, nodeId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetTagsResponse, error) { rsp, err := c.SetTagsWithBody(ctx, nodeId, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseSetTagsResponse(rsp) } // SetTagsWithResponse Set tags // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/node/{nodeId}/tags (the `SetTags` operationId). func (c *ClientWithResponses) SetTagsWithResponse(ctx context.Context, nodeId string, body SetTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetTagsResponse, error) { rsp, err := c.SetTags(ctx, nodeId, body, reqEditors...) if err != nil { return nil, err } return ParseSetTagsResponse(rsp) } // GetPolicyWithResponse Get policy // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/policy (the `GetPolicy` operationId). func (c *ClientWithResponses) GetPolicyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetPolicyResponse, error) { rsp, err := c.GetPolicy(ctx, reqEditors...) if err != nil { return nil, err } return ParseGetPolicyResponse(rsp) } // SetPolicyWithBodyWithResponse Set policy // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). func (c *ClientWithResponses) SetPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetPolicyResponse, error) { rsp, err := c.SetPolicyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseSetPolicyResponse(rsp) } // SetPolicyWithResponse Set policy // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with PUT /api/v1/policy (the `SetPolicy` operationId). func (c *ClientWithResponses) SetPolicyWithResponse(ctx context.Context, body SetPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*SetPolicyResponse, error) { rsp, err := c.SetPolicy(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseSetPolicyResponse(rsp) } // CheckPolicyWithBodyWithResponse Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). func (c *ClientWithResponses) CheckPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CheckPolicyResponse, error) { rsp, err := c.CheckPolicyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCheckPolicyResponse(rsp) } // CheckPolicyWithResponse Check policy // // Validates the given policy against the server's live users and nodes without persisting it. // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/policy/check (the `CheckPolicy` operationId). func (c *ClientWithResponses) CheckPolicyWithResponse(ctx context.Context, body CheckPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CheckPolicyResponse, error) { rsp, err := c.CheckPolicy(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCheckPolicyResponse(rsp) } // DeletePreAuthKeyWithResponse Delete pre-auth key // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/preauthkey (the `DeletePreAuthKey` operationId). func (c *ClientWithResponses) DeletePreAuthKeyWithResponse(ctx context.Context, params *DeletePreAuthKeyParams, reqEditors ...RequestEditorFn) (*DeletePreAuthKeyResponse, error) { rsp, err := c.DeletePreAuthKey(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseDeletePreAuthKeyResponse(rsp) } // ListPreAuthKeysWithResponse List pre-auth keys // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/preauthkey (the `ListPreAuthKeys` operationId). func (c *ClientWithResponses) ListPreAuthKeysWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListPreAuthKeysResponse, error) { rsp, err := c.ListPreAuthKeys(ctx, reqEditors...) if err != nil { return nil, err } return ParseListPreAuthKeysResponse(rsp) } // CreatePreAuthKeyWithBodyWithResponse Create pre-auth key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). func (c *ClientWithResponses) CreatePreAuthKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePreAuthKeyResponse, error) { rsp, err := c.CreatePreAuthKeyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreatePreAuthKeyResponse(rsp) } // CreatePreAuthKeyWithResponse Create pre-auth key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey (the `CreatePreAuthKey` operationId). func (c *ClientWithResponses) CreatePreAuthKeyWithResponse(ctx context.Context, body CreatePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePreAuthKeyResponse, error) { rsp, err := c.CreatePreAuthKey(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreatePreAuthKeyResponse(rsp) } // ExpirePreAuthKeyWithBodyWithResponse Expire pre-auth key // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). func (c *ClientWithResponses) ExpirePreAuthKeyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ExpirePreAuthKeyResponse, error) { rsp, err := c.ExpirePreAuthKeyWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseExpirePreAuthKeyResponse(rsp) } // ExpirePreAuthKeyWithResponse Expire pre-auth key // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/preauthkey/expire (the `ExpirePreAuthKey` operationId). func (c *ClientWithResponses) ExpirePreAuthKeyWithResponse(ctx context.Context, body ExpirePreAuthKeyJSONRequestBody, reqEditors ...RequestEditorFn) (*ExpirePreAuthKeyResponse, error) { rsp, err := c.ExpirePreAuthKey(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseExpirePreAuthKeyResponse(rsp) } // ListUsersWithResponse List users // // Returns a wrapper object for the known response body format(s). // // Corresponds with GET /api/v1/user (the `ListUsers` operationId). func (c *ClientWithResponses) ListUsersWithResponse(ctx context.Context, params *ListUsersParams, reqEditors ...RequestEditorFn) (*ListUsersResponse, error) { rsp, err := c.ListUsers(ctx, params, reqEditors...) if err != nil { return nil, err } return ParseListUsersResponse(rsp) } // CreateUserWithBodyWithResponse Create user // // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). func (c *ClientWithResponses) CreateUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) { rsp, err := c.CreateUserWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } return ParseCreateUserResponse(rsp) } // CreateUserWithResponse Create user // // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/user (the `CreateUser` operationId). func (c *ClientWithResponses) CreateUserWithResponse(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) { rsp, err := c.CreateUser(ctx, body, reqEditors...) if err != nil { return nil, err } return ParseCreateUserResponse(rsp) } // DeleteUserWithResponse Delete user // // Returns a wrapper object for the known response body format(s). // // Corresponds with DELETE /api/v1/user/{id} (the `DeleteUser` operationId). func (c *ClientWithResponses) DeleteUserWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteUserResponse, error) { rsp, err := c.DeleteUser(ctx, id, reqEditors...) if err != nil { return nil, err } return ParseDeleteUserResponse(rsp) } // RenameUserWithResponse Rename user // // Returns a wrapper object for the known response body format(s). // // Corresponds with POST /api/v1/user/{oldId}/rename/{newName} (the `RenameUser` operationId). func (c *ClientWithResponses) RenameUserWithResponse(ctx context.Context, oldId string, newName string, reqEditors ...RequestEditorFn) (*RenameUserResponse, error) { rsp, err := c.RenameUser(ctx, oldId, newName, reqEditors...) if err != nil { return nil, err } return ParseRenameUserResponse(rsp) } // ParseListApiKeysResponse parses an HTTP response from a ListApiKeysWithResponse call func ParseListApiKeysResponse(rsp *http.Response) (*ListApiKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListApiKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest ListApiKeysOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseCreateApiKeyResponse parses an HTTP response from a CreateApiKeyWithResponse call func ParseCreateApiKeyResponse(rsp *http.Response) (*CreateApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest CreateApiKeyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseExpireApiKeyResponse parses an HTTP response from a ExpireApiKeyWithResponse call func ParseExpireApiKeyResponse(rsp *http.Response) (*ExpireApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ExpireApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest ExpireApiKeyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseDeleteApiKeyResponse parses an HTTP response from a DeleteApiKeyWithResponse call func ParseDeleteApiKeyResponse(rsp *http.Response) (*DeleteApiKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteApiKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest DeleteApiKeyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseAuthApproveResponse parses an HTTP response from a AuthApproveWithResponse call func ParseAuthApproveResponse(rsp *http.Response) (*AuthApproveResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &AuthApproveResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest AuthApproveOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseAuthRegisterResponse parses an HTTP response from a AuthRegisterWithResponse call func ParseAuthRegisterResponse(rsp *http.Response) (*AuthRegisterResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &AuthRegisterResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest AuthRegisterOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseAuthRejectResponse parses an HTTP response from a AuthRejectWithResponse call func ParseAuthRejectResponse(rsp *http.Response) (*AuthRejectResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &AuthRejectResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest AuthRejectOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseDebugCreateNodeResponse parses an HTTP response from a DebugCreateNodeWithResponse call func ParseDebugCreateNodeResponse(rsp *http.Response) (*DebugCreateNodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DebugCreateNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseHealthResponse parses an HTTP response from a HealthWithResponse call func ParseHealthResponse(rsp *http.Response) (*HealthResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &HealthResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest HealthResponseBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseListNodesResponse parses an HTTP response from a ListNodesWithResponse call func ParseListNodesResponse(rsp *http.Response) (*ListNodesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListNodesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest ListNodesOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseBackfillNodeIPsResponse parses an HTTP response from a BackfillNodeIPsWithResponse call func ParseBackfillNodeIPsResponse(rsp *http.Response) (*BackfillNodeIPsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &BackfillNodeIPsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest BackfillNodeIPsOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseRegisterNodeResponse parses an HTTP response from a RegisterNodeWithResponse call func ParseRegisterNodeResponse(rsp *http.Response) (*RegisterNodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &RegisterNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseDeleteNodeResponse parses an HTTP response from a DeleteNodeWithResponse call func ParseDeleteNodeResponse(rsp *http.Response) (*DeleteNodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest DeleteNodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseGetNodeResponse parses an HTTP response from a GetNodeWithResponse call func ParseGetNodeResponse(rsp *http.Response) (*GetNodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseSetApprovedRoutesResponse parses an HTTP response from a SetApprovedRoutesWithResponse call func ParseSetApprovedRoutesResponse(rsp *http.Response) (*SetApprovedRoutesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &SetApprovedRoutesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseExpireNodeResponse parses an HTTP response from a ExpireNodeWithResponse call func ParseExpireNodeResponse(rsp *http.Response) (*ExpireNodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ExpireNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseRenameNodeResponse parses an HTTP response from a RenameNodeWithResponse call func ParseRenameNodeResponse(rsp *http.Response) (*RenameNodeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &RenameNodeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseSetTagsResponse parses an HTTP response from a SetTagsWithResponse call func ParseSetTagsResponse(rsp *http.Response) (*SetTagsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &SetTagsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest NodeOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseGetPolicyResponse parses an HTTP response from a GetPolicyWithResponse call func ParseGetPolicyResponse(rsp *http.Response) (*GetPolicyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &GetPolicyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PolicyResponseBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseSetPolicyResponse parses an HTTP response from a SetPolicyWithResponse call func ParseSetPolicyResponse(rsp *http.Response) (*SetPolicyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &SetPolicyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PolicyResponseBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseCheckPolicyResponse parses an HTTP response from a CheckPolicyWithResponse call func ParseCheckPolicyResponse(rsp *http.Response) (*CheckPolicyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CheckPolicyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest CheckPolicyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseDeletePreAuthKeyResponse parses an HTTP response from a DeletePreAuthKeyWithResponse call func ParseDeletePreAuthKeyResponse(rsp *http.Response) (*DeletePreAuthKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeletePreAuthKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest DeletePreAuthKeyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseListPreAuthKeysResponse parses an HTTP response from a ListPreAuthKeysWithResponse call func ParseListPreAuthKeysResponse(rsp *http.Response) (*ListPreAuthKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ListPreAuthKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest ListPreAuthKeysOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseCreatePreAuthKeyResponse parses an HTTP response from a CreatePreAuthKeyWithResponse call func ParseCreatePreAuthKeyResponse(rsp *http.Response) (*CreatePreAuthKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreatePreAuthKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest PreAuthKeyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseExpirePreAuthKeyResponse parses an HTTP response from a ExpirePreAuthKeyWithResponse call func ParseExpirePreAuthKeyResponse(rsp *http.Response) (*ExpirePreAuthKeyResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &ExpirePreAuthKeyResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest ExpirePreAuthKeyOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &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 ListUsersOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseCreateUserResponse parses an HTTP response from a CreateUserWithResponse call func ParseCreateUserResponse(rsp *http.Response) (*CreateUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &CreateUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest UserOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseDeleteUserResponse parses an HTTP response from a DeleteUserWithResponse call func ParseDeleteUserResponse(rsp *http.Response) (*DeleteUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &DeleteUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest DeleteUserOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil } // ParseRenameUserResponse parses an HTTP response from a RenameUserWithResponse call func ParseRenameUserResponse(rsp *http.Response) (*RenameUserResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } response := &RenameUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest UserOutputBody if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest ErrorModel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.ApplicationproblemJSONDefault = &dest } return response, nil }