github.com/FusionAuth/go-client@v0.0.0-20240425220342-2317e10dfcf5/pkg/fusionauth/Client.go (about)

     1  /*
     2  * Copyright (c) 2019-2023, FusionAuth, All Rights Reserved
     3  *
     4  * Licensed under the Apache License, Version 2.0 (the "License");
     5  * you may not use this file except in compliance with the License.
     6  * You may obtain a copy of the License at
     7  *
     8  *   http://www.apache.org/licenses/LICENSE-2.0
     9  *
    10  * Unless required by applicable law or agreed to in writing,
    11  * software distributed under the License is distributed on an
    12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    13  * either express or implied. See the License for the specific
    14  * language governing permissions and limitations under the License.
    15   */
    16  
    17  package fusionauth
    18  
    19  import (
    20  	"bytes"
    21  	"context"
    22  	"encoding/json"
    23  	"fmt"
    24  	"io"
    25  	"net/http"
    26  	"net/http/httputil"
    27  	"net/url"
    28  	"path"
    29  	"strconv"
    30  	"strings"
    31  	"time"
    32  )
    33  
    34  // NewClient creates a new FusionAuthClient
    35  // if httpClient is nil then a DefaultClient is used
    36  func NewClient(httpClient *http.Client, baseURL *url.URL, apiKey string) *FusionAuthClient {
    37  	if httpClient == nil {
    38  		httpClient = &http.Client{
    39  			Timeout: 5 * time.Minute,
    40  		}
    41  	}
    42  	c := &FusionAuthClient{
    43  		HTTPClient: httpClient,
    44  		BaseURL:    baseURL,
    45  		APIKey:     apiKey,
    46  	}
    47  
    48  	return c
    49  }
    50  
    51  // SetTenantId sets the tenantId on the client
    52  func (c *FusionAuthClient) SetTenantId(tenantId string) {
    53  	c.TenantId = tenantId
    54  }
    55  
    56  // FusionAuthClient describes the Go Client for interacting with FusionAuth's RESTful API
    57  type FusionAuthClient struct {
    58  	HTTPClient *http.Client
    59  	BaseURL    *url.URL
    60  	APIKey     string
    61  	Debug      bool
    62  	TenantId   string
    63  }
    64  
    65  type restClient struct {
    66  	Body        io.Reader
    67  	Debug       bool
    68  	ErrorRef    interface{}
    69  	Headers     map[string]string
    70  	HTTPClient  *http.Client
    71  	Method      string
    72  	ResponseRef interface{}
    73  	Uri         *url.URL
    74  }
    75  
    76  func (c *FusionAuthClient) Start(responseRef interface{}, errorRef interface{}) *restClient {
    77  	return c.StartAnonymous(responseRef, errorRef).WithAuthorization(c.APIKey)
    78  }
    79  
    80  func (c *FusionAuthClient) StartAnonymous(responseRef interface{}, errorRef interface{}) *restClient {
    81  	rc := &restClient{
    82  		Debug:       c.Debug,
    83  		ErrorRef:    errorRef,
    84  		Headers:     make(map[string]string),
    85  		HTTPClient:  c.HTTPClient,
    86  		ResponseRef: responseRef,
    87  	}
    88  	rc.Uri, _ = url.Parse(c.BaseURL.String())
    89  	if c.TenantId != "" {
    90  		rc.WithHeader("X-FusionAuth-TenantId", c.TenantId)
    91  	}
    92  
    93  	rc.WithHeader("Accept", "application/json")
    94  	return rc
    95  }
    96  
    97  func (rc *restClient) Do(ctx context.Context) error {
    98  	req, err := http.NewRequestWithContext(ctx, rc.Method, rc.Uri.String(), rc.Body)
    99  	if err != nil {
   100  		return err
   101  	}
   102  	for key, val := range rc.Headers {
   103  		req.Header.Set(key, val)
   104  	}
   105  	resp, err := rc.HTTPClient.Do(req)
   106  	if err != nil {
   107  		return err
   108  	}
   109  	defer resp.Body.Close()
   110  	if rc.Debug {
   111  		responseDump, _ := httputil.DumpResponse(resp, true)
   112  		fmt.Println(string(responseDump))
   113  	}
   114  	if resp.StatusCode < 200 || resp.StatusCode > 299 {
   115  		if err = json.NewDecoder(resp.Body).Decode(rc.ErrorRef); err == io.EOF {
   116  			err = nil
   117  		}
   118  	} else {
   119  		rc.ErrorRef = nil
   120  		if _, ok := rc.ResponseRef.(*BaseHTTPResponse); !ok {
   121  			err = json.NewDecoder(resp.Body).Decode(rc.ResponseRef)
   122  		}
   123  	}
   124  	rc.ResponseRef.(StatusAble).SetStatus(resp.StatusCode)
   125  	return err
   126  }
   127  
   128  func (rc *restClient) WithAuthorization(key string) *restClient {
   129  	if key != "" {
   130  		rc.WithHeader("Authorization", key)
   131  	}
   132  	return rc
   133  }
   134  
   135  func (rc *restClient) WithFormData(formBody url.Values) *restClient {
   136  	rc.WithHeader("Content-Type", "application/x-www-form-urlencoded")
   137  	rc.Body = strings.NewReader(formBody.Encode())
   138  	return rc
   139  }
   140  
   141  func (rc *restClient) WithHeader(key string, value string) *restClient {
   142  	rc.Headers[key] = value
   143  	return rc
   144  }
   145  
   146  func (rc *restClient) WithJSONBody(body interface{}) *restClient {
   147  	rc.WithHeader("Content-Type", "application/json")
   148  	buf := new(bytes.Buffer)
   149  	json.NewEncoder(buf).Encode(body)
   150  	rc.Body = buf
   151  	return rc
   152  }
   153  
   154  func (rc *restClient) WithMethod(method string) *restClient {
   155  	rc.Method = method
   156  	return rc
   157  }
   158  
   159  func (rc *restClient) WithParameter(key string, value interface{}) *restClient {
   160  	q := rc.Uri.Query()
   161  	if x, ok := value.([]string); ok {
   162  		for _, i := range x {
   163  			q.Add(key, i)
   164  		}
   165  	} else {
   166  		q.Add(key, fmt.Sprintf("%v", value))
   167  	}
   168  	rc.Uri.RawQuery = q.Encode()
   169  	return rc
   170  }
   171  
   172  func (rc *restClient) WithUri(uri string) *restClient {
   173  	rc.Uri.Path = path.Join(rc.Uri.Path, uri)
   174  	return rc
   175  }
   176  
   177  func (rc *restClient) WithUriSegment(segment string) *restClient {
   178  	if segment != "" {
   179  		rc.Uri.Path = path.Join(rc.Uri.Path, "/"+segment)
   180  	}
   181  	return rc
   182  }
   183  
   184  // ActionUser
   185  // Takes an action on a user. The user being actioned is called the "actionee" and the user taking the action is called the
   186  // "actioner". Both user ids are required in the request object.
   187  //
   188  //	ActionRequest request The action request that includes all the information about the action being taken including
   189  //	the Id of the action, any options and the duration (if applicable).
   190  func (c *FusionAuthClient) ActionUser(request ActionRequest) (*ActionResponse, *Errors, error) {
   191  	return c.ActionUserWithContext(context.TODO(), request)
   192  }
   193  
   194  // ActionUserWithContext
   195  // Takes an action on a user. The user being actioned is called the "actionee" and the user taking the action is called the
   196  // "actioner". Both user ids are required in the request object.
   197  //
   198  //	ActionRequest request The action request that includes all the information about the action being taken including
   199  //	the Id of the action, any options and the duration (if applicable).
   200  func (c *FusionAuthClient) ActionUserWithContext(ctx context.Context, request ActionRequest) (*ActionResponse, *Errors, error) {
   201  	var resp ActionResponse
   202  	var errors Errors
   203  
   204  	restClient := c.Start(&resp, &errors)
   205  	err := restClient.WithUri("/api/user/action").
   206  		WithJSONBody(request).
   207  		WithMethod(http.MethodPost).
   208  		Do(ctx)
   209  	if restClient.ErrorRef == nil {
   210  		return &resp, nil, err
   211  	}
   212  	return &resp, &errors, err
   213  }
   214  
   215  // ActivateReactor
   216  // Activates the FusionAuth Reactor using a license Id and optionally a license text (for air-gapped deployments)
   217  //
   218  //	ReactorRequest request An optional request that contains the license text to activate Reactor (useful for air-gap deployments of FusionAuth).
   219  func (c *FusionAuthClient) ActivateReactor(request ReactorRequest) (*BaseHTTPResponse, *Errors, error) {
   220  	return c.ActivateReactorWithContext(context.TODO(), request)
   221  }
   222  
   223  // ActivateReactorWithContext
   224  // Activates the FusionAuth Reactor using a license Id and optionally a license text (for air-gapped deployments)
   225  //
   226  //	ReactorRequest request An optional request that contains the license text to activate Reactor (useful for air-gap deployments of FusionAuth).
   227  func (c *FusionAuthClient) ActivateReactorWithContext(ctx context.Context, request ReactorRequest) (*BaseHTTPResponse, *Errors, error) {
   228  	var resp BaseHTTPResponse
   229  	var errors Errors
   230  
   231  	restClient := c.Start(&resp, &errors)
   232  	err := restClient.WithUri("/api/reactor").
   233  		WithJSONBody(request).
   234  		WithMethod(http.MethodPost).
   235  		Do(ctx)
   236  	if restClient.ErrorRef == nil {
   237  		return &resp, nil, err
   238  	}
   239  	return &resp, &errors, err
   240  }
   241  
   242  // AddUserToFamily
   243  // Adds a user to an existing family. The family Id must be specified.
   244  //
   245  //	string familyId The Id of the family.
   246  //	FamilyRequest request The request object that contains all the information used to determine which user to add to the family.
   247  func (c *FusionAuthClient) AddUserToFamily(familyId string, request FamilyRequest) (*FamilyResponse, *Errors, error) {
   248  	return c.AddUserToFamilyWithContext(context.TODO(), familyId, request)
   249  }
   250  
   251  // AddUserToFamilyWithContext
   252  // Adds a user to an existing family. The family Id must be specified.
   253  //
   254  //	string familyId The Id of the family.
   255  //	FamilyRequest request The request object that contains all the information used to determine which user to add to the family.
   256  func (c *FusionAuthClient) AddUserToFamilyWithContext(ctx context.Context, familyId string, request FamilyRequest) (*FamilyResponse, *Errors, error) {
   257  	var resp FamilyResponse
   258  	var errors Errors
   259  
   260  	restClient := c.Start(&resp, &errors)
   261  	err := restClient.WithUri("/api/user/family").
   262  		WithUriSegment(familyId).
   263  		WithJSONBody(request).
   264  		WithMethod(http.MethodPut).
   265  		Do(ctx)
   266  	if restClient.ErrorRef == nil {
   267  		return &resp, nil, err
   268  	}
   269  	return &resp, &errors, err
   270  }
   271  
   272  // ApproveDevice
   273  // Approve a device grant.
   274  //
   275  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.
   276  //	string clientSecret (Optional) The client secret. This value will be required if client authentication is enabled.
   277  //	string token The access token used to identify the user.
   278  //	string userCode The end-user verification code.
   279  func (c *FusionAuthClient) ApproveDevice(clientId string, clientSecret string, token string, userCode string) (*DeviceApprovalResponse, *Errors, error) {
   280  	return c.ApproveDeviceWithContext(context.TODO(), clientId, clientSecret, token, userCode)
   281  }
   282  
   283  // ApproveDeviceWithContext
   284  // Approve a device grant.
   285  //
   286  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.
   287  //	string clientSecret (Optional) The client secret. This value will be required if client authentication is enabled.
   288  //	string token The access token used to identify the user.
   289  //	string userCode The end-user verification code.
   290  func (c *FusionAuthClient) ApproveDeviceWithContext(ctx context.Context, clientId string, clientSecret string, token string, userCode string) (*DeviceApprovalResponse, *Errors, error) {
   291  	var resp DeviceApprovalResponse
   292  	var errors Errors
   293  	formBody := url.Values{}
   294  	formBody.Set("client_id", clientId)
   295  	formBody.Set("client_secret", clientSecret)
   296  	formBody.Set("token", token)
   297  	formBody.Set("user_code", userCode)
   298  
   299  	restClient := c.Start(&resp, &errors)
   300  	err := restClient.WithUri("/oauth2/device/approve").
   301  		WithFormData(formBody).
   302  		WithMethod(http.MethodPost).
   303  		Do(ctx)
   304  	if restClient.ErrorRef == nil {
   305  		return &resp, nil, err
   306  	}
   307  	return &resp, &errors, err
   308  }
   309  
   310  // CancelAction
   311  // Cancels the user action.
   312  //
   313  //	string actionId The action Id of the action to cancel.
   314  //	ActionRequest request The action request that contains the information about the cancellation.
   315  func (c *FusionAuthClient) CancelAction(actionId string, request ActionRequest) (*ActionResponse, *Errors, error) {
   316  	return c.CancelActionWithContext(context.TODO(), actionId, request)
   317  }
   318  
   319  // CancelActionWithContext
   320  // Cancels the user action.
   321  //
   322  //	string actionId The action Id of the action to cancel.
   323  //	ActionRequest request The action request that contains the information about the cancellation.
   324  func (c *FusionAuthClient) CancelActionWithContext(ctx context.Context, actionId string, request ActionRequest) (*ActionResponse, *Errors, error) {
   325  	var resp ActionResponse
   326  	var errors Errors
   327  
   328  	restClient := c.Start(&resp, &errors)
   329  	err := restClient.WithUri("/api/user/action").
   330  		WithUriSegment(actionId).
   331  		WithJSONBody(request).
   332  		WithMethod(http.MethodDelete).
   333  		Do(ctx)
   334  	if restClient.ErrorRef == nil {
   335  		return &resp, nil, err
   336  	}
   337  	return &resp, &errors, err
   338  }
   339  
   340  // ChangePassword
   341  // Changes a user's password using the change password Id. This usually occurs after an email has been sent to the user
   342  // and they clicked on a link to reset their password.
   343  //
   344  // As of version 1.32.2, prefer sending the changePasswordId in the request body. To do this, omit the first parameter, and set
   345  // the value in the request body.
   346  //
   347  //	string changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
   348  //	ChangePasswordRequest request The change password request that contains all the information used to change the password.
   349  func (c *FusionAuthClient) ChangePassword(changePasswordId string, request ChangePasswordRequest) (*ChangePasswordResponse, *Errors, error) {
   350  	return c.ChangePasswordWithContext(context.TODO(), changePasswordId, request)
   351  }
   352  
   353  // ChangePasswordWithContext
   354  // Changes a user's password using the change password Id. This usually occurs after an email has been sent to the user
   355  // and they clicked on a link to reset their password.
   356  //
   357  // As of version 1.32.2, prefer sending the changePasswordId in the request body. To do this, omit the first parameter, and set
   358  // the value in the request body.
   359  //
   360  //	string changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
   361  //	ChangePasswordRequest request The change password request that contains all the information used to change the password.
   362  func (c *FusionAuthClient) ChangePasswordWithContext(ctx context.Context, changePasswordId string, request ChangePasswordRequest) (*ChangePasswordResponse, *Errors, error) {
   363  	var resp ChangePasswordResponse
   364  	var errors Errors
   365  
   366  	restClient := c.StartAnonymous(&resp, &errors)
   367  	err := restClient.WithUri("/api/user/change-password").
   368  		WithUriSegment(changePasswordId).
   369  		WithJSONBody(request).
   370  		WithMethod(http.MethodPost).
   371  		Do(ctx)
   372  	if restClient.ErrorRef == nil {
   373  		return &resp, nil, err
   374  	}
   375  	return &resp, &errors, err
   376  }
   377  
   378  // ChangePasswordByIdentity
   379  // Changes a user's password using their identity (loginId and password). Using a loginId instead of the changePasswordId
   380  // bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword
   381  // method.
   382  //
   383  //	ChangePasswordRequest request The change password request that contains all the information used to change the password.
   384  func (c *FusionAuthClient) ChangePasswordByIdentity(request ChangePasswordRequest) (*BaseHTTPResponse, *Errors, error) {
   385  	return c.ChangePasswordByIdentityWithContext(context.TODO(), request)
   386  }
   387  
   388  // ChangePasswordByIdentityWithContext
   389  // Changes a user's password using their identity (loginId and password). Using a loginId instead of the changePasswordId
   390  // bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword
   391  // method.
   392  //
   393  //	ChangePasswordRequest request The change password request that contains all the information used to change the password.
   394  func (c *FusionAuthClient) ChangePasswordByIdentityWithContext(ctx context.Context, request ChangePasswordRequest) (*BaseHTTPResponse, *Errors, error) {
   395  	var resp BaseHTTPResponse
   396  	var errors Errors
   397  
   398  	restClient := c.Start(&resp, &errors)
   399  	err := restClient.WithUri("/api/user/change-password").
   400  		WithJSONBody(request).
   401  		WithMethod(http.MethodPost).
   402  		Do(ctx)
   403  	if restClient.ErrorRef == nil {
   404  		return &resp, nil, err
   405  	}
   406  	return &resp, &errors, err
   407  }
   408  
   409  // CheckChangePasswordUsingId
   410  // Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
   411  // When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
   412  // your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
   413  //
   414  // An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
   415  //
   416  //	string changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
   417  func (c *FusionAuthClient) CheckChangePasswordUsingId(changePasswordId string) (*BaseHTTPResponse, *Errors, error) {
   418  	return c.CheckChangePasswordUsingIdWithContext(context.TODO(), changePasswordId)
   419  }
   420  
   421  // CheckChangePasswordUsingIdWithContext
   422  // Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
   423  // When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
   424  // your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
   425  //
   426  // An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
   427  //
   428  //	string changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
   429  func (c *FusionAuthClient) CheckChangePasswordUsingIdWithContext(ctx context.Context, changePasswordId string) (*BaseHTTPResponse, *Errors, error) {
   430  	var resp BaseHTTPResponse
   431  	var errors Errors
   432  
   433  	restClient := c.StartAnonymous(&resp, &errors)
   434  	err := restClient.WithUri("/api/user/change-password").
   435  		WithUriSegment(changePasswordId).
   436  		WithMethod(http.MethodGet).
   437  		Do(ctx)
   438  	if restClient.ErrorRef == nil {
   439  		return &resp, nil, err
   440  	}
   441  	return &resp, &errors, err
   442  }
   443  
   444  // CheckChangePasswordUsingJWT
   445  // Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
   446  // When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
   447  // your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
   448  //
   449  // An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
   450  //
   451  //	string encodedJWT The encoded JWT (access token).
   452  func (c *FusionAuthClient) CheckChangePasswordUsingJWT(encodedJWT string) (*BaseHTTPResponse, *Errors, error) {
   453  	return c.CheckChangePasswordUsingJWTWithContext(context.TODO(), encodedJWT)
   454  }
   455  
   456  // CheckChangePasswordUsingJWTWithContext
   457  // Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
   458  // When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
   459  // your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
   460  //
   461  // An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
   462  //
   463  //	string encodedJWT The encoded JWT (access token).
   464  func (c *FusionAuthClient) CheckChangePasswordUsingJWTWithContext(ctx context.Context, encodedJWT string) (*BaseHTTPResponse, *Errors, error) {
   465  	var resp BaseHTTPResponse
   466  	var errors Errors
   467  
   468  	restClient := c.StartAnonymous(&resp, &errors)
   469  	err := restClient.WithUri("/api/user/change-password").
   470  		WithAuthorization("Bearer " + encodedJWT).
   471  		WithMethod(http.MethodGet).
   472  		Do(ctx)
   473  	if restClient.ErrorRef == nil {
   474  		return &resp, nil, err
   475  	}
   476  	return &resp, &errors, err
   477  }
   478  
   479  // CheckChangePasswordUsingLoginId
   480  // Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
   481  // When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
   482  // your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
   483  //
   484  // An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
   485  //
   486  //	string loginId The loginId of the User that you intend to change the password for.
   487  func (c *FusionAuthClient) CheckChangePasswordUsingLoginId(loginId string) (*BaseHTTPResponse, *Errors, error) {
   488  	return c.CheckChangePasswordUsingLoginIdWithContext(context.TODO(), loginId)
   489  }
   490  
   491  // CheckChangePasswordUsingLoginIdWithContext
   492  // Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
   493  // When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
   494  // your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
   495  //
   496  // An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
   497  //
   498  //	string loginId The loginId of the User that you intend to change the password for.
   499  func (c *FusionAuthClient) CheckChangePasswordUsingLoginIdWithContext(ctx context.Context, loginId string) (*BaseHTTPResponse, *Errors, error) {
   500  	var resp BaseHTTPResponse
   501  	var errors Errors
   502  
   503  	restClient := c.Start(&resp, &errors)
   504  	err := restClient.WithUri("/api/user/change-password").
   505  		WithParameter("username", loginId).
   506  		WithMethod(http.MethodGet).
   507  		Do(ctx)
   508  	if restClient.ErrorRef == nil {
   509  		return &resp, nil, err
   510  	}
   511  	return &resp, &errors, err
   512  }
   513  
   514  // ClientCredentialsGrant
   515  // Make a Client Credentials grant request to obtain an access token.
   516  //
   517  //	string clientId (Optional) The client identifier. The client Id is the Id of the FusionAuth Entity in which you are attempting to authenticate.
   518  //	This parameter is optional when Basic Authorization is used to authenticate this request.
   519  //	string clientSecret (Optional) The client secret used to authenticate this request.
   520  //	This parameter is optional when Basic Authorization is used to authenticate this request.
   521  //	string scope (Optional) This parameter is used to indicate which target entity you are requesting access. To request access to an entity, use the format target-entity:&lt;target-entity-id&gt;:&lt;roles&gt;. Roles are an optional comma separated list.
   522  func (c *FusionAuthClient) ClientCredentialsGrant(clientId string, clientSecret string, scope string) (*AccessToken, *OAuthError, error) {
   523  	return c.ClientCredentialsGrantWithContext(context.TODO(), clientId, clientSecret, scope)
   524  }
   525  
   526  // ClientCredentialsGrantWithContext
   527  // Make a Client Credentials grant request to obtain an access token.
   528  //
   529  //	string clientId (Optional) The client identifier. The client Id is the Id of the FusionAuth Entity in which you are attempting to authenticate.
   530  //	This parameter is optional when Basic Authorization is used to authenticate this request.
   531  //	string clientSecret (Optional) The client secret used to authenticate this request.
   532  //	This parameter is optional when Basic Authorization is used to authenticate this request.
   533  //	string scope (Optional) This parameter is used to indicate which target entity you are requesting access. To request access to an entity, use the format target-entity:&lt;target-entity-id&gt;:&lt;roles&gt;. Roles are an optional comma separated list.
   534  func (c *FusionAuthClient) ClientCredentialsGrantWithContext(ctx context.Context, clientId string, clientSecret string, scope string) (*AccessToken, *OAuthError, error) {
   535  	var resp AccessToken
   536  	var errors OAuthError
   537  	formBody := url.Values{}
   538  	formBody.Set("client_id", clientId)
   539  	formBody.Set("client_secret", clientSecret)
   540  	formBody.Set("grant_type", "client_credentials")
   541  	formBody.Set("scope", scope)
   542  
   543  	restClient := c.StartAnonymous(&resp, &errors)
   544  	err := restClient.WithUri("/oauth2/token").
   545  		WithFormData(formBody).
   546  		WithMethod(http.MethodPost).
   547  		Do(ctx)
   548  	if restClient.ErrorRef == nil {
   549  		return &resp, nil, err
   550  	}
   551  	return &resp, &errors, err
   552  }
   553  
   554  // CommentOnUser
   555  // Adds a comment to the user's account.
   556  //
   557  //	UserCommentRequest request The request object that contains all the information used to create the user comment.
   558  func (c *FusionAuthClient) CommentOnUser(request UserCommentRequest) (*UserCommentResponse, *Errors, error) {
   559  	return c.CommentOnUserWithContext(context.TODO(), request)
   560  }
   561  
   562  // CommentOnUserWithContext
   563  // Adds a comment to the user's account.
   564  //
   565  //	UserCommentRequest request The request object that contains all the information used to create the user comment.
   566  func (c *FusionAuthClient) CommentOnUserWithContext(ctx context.Context, request UserCommentRequest) (*UserCommentResponse, *Errors, error) {
   567  	var resp UserCommentResponse
   568  	var errors Errors
   569  
   570  	restClient := c.Start(&resp, &errors)
   571  	err := restClient.WithUri("/api/user/comment").
   572  		WithJSONBody(request).
   573  		WithMethod(http.MethodPost).
   574  		Do(ctx)
   575  	if restClient.ErrorRef == nil {
   576  		return &resp, nil, err
   577  	}
   578  	return &resp, &errors, err
   579  }
   580  
   581  // CompleteWebAuthnAssertion
   582  // Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
   583  //
   584  //	WebAuthnLoginRequest request An object containing data necessary for completing the authentication ceremony
   585  func (c *FusionAuthClient) CompleteWebAuthnAssertion(request WebAuthnLoginRequest) (*WebAuthnAssertResponse, *Errors, error) {
   586  	return c.CompleteWebAuthnAssertionWithContext(context.TODO(), request)
   587  }
   588  
   589  // CompleteWebAuthnAssertionWithContext
   590  // Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
   591  //
   592  //	WebAuthnLoginRequest request An object containing data necessary for completing the authentication ceremony
   593  func (c *FusionAuthClient) CompleteWebAuthnAssertionWithContext(ctx context.Context, request WebAuthnLoginRequest) (*WebAuthnAssertResponse, *Errors, error) {
   594  	var resp WebAuthnAssertResponse
   595  	var errors Errors
   596  
   597  	restClient := c.StartAnonymous(&resp, &errors)
   598  	err := restClient.WithUri("/api/webauthn/assert").
   599  		WithJSONBody(request).
   600  		WithMethod(http.MethodPost).
   601  		Do(ctx)
   602  	if restClient.ErrorRef == nil {
   603  		return &resp, nil, err
   604  	}
   605  	return &resp, &errors, err
   606  }
   607  
   608  // CompleteWebAuthnLogin
   609  // Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
   610  //
   611  //	WebAuthnLoginRequest request An object containing data necessary for completing the authentication ceremony
   612  func (c *FusionAuthClient) CompleteWebAuthnLogin(request WebAuthnLoginRequest) (*LoginResponse, *Errors, error) {
   613  	return c.CompleteWebAuthnLoginWithContext(context.TODO(), request)
   614  }
   615  
   616  // CompleteWebAuthnLoginWithContext
   617  // Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
   618  //
   619  //	WebAuthnLoginRequest request An object containing data necessary for completing the authentication ceremony
   620  func (c *FusionAuthClient) CompleteWebAuthnLoginWithContext(ctx context.Context, request WebAuthnLoginRequest) (*LoginResponse, *Errors, error) {
   621  	var resp LoginResponse
   622  	var errors Errors
   623  
   624  	restClient := c.StartAnonymous(&resp, &errors)
   625  	err := restClient.WithUri("/api/webauthn/login").
   626  		WithJSONBody(request).
   627  		WithMethod(http.MethodPost).
   628  		Do(ctx)
   629  	if restClient.ErrorRef == nil {
   630  		return &resp, nil, err
   631  	}
   632  	return &resp, &errors, err
   633  }
   634  
   635  // CompleteWebAuthnRegistration
   636  // Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
   637  //
   638  //	WebAuthnRegisterCompleteRequest request An object containing data necessary for completing the registration ceremony
   639  func (c *FusionAuthClient) CompleteWebAuthnRegistration(request WebAuthnRegisterCompleteRequest) (*WebAuthnRegisterCompleteResponse, *Errors, error) {
   640  	return c.CompleteWebAuthnRegistrationWithContext(context.TODO(), request)
   641  }
   642  
   643  // CompleteWebAuthnRegistrationWithContext
   644  // Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
   645  //
   646  //	WebAuthnRegisterCompleteRequest request An object containing data necessary for completing the registration ceremony
   647  func (c *FusionAuthClient) CompleteWebAuthnRegistrationWithContext(ctx context.Context, request WebAuthnRegisterCompleteRequest) (*WebAuthnRegisterCompleteResponse, *Errors, error) {
   648  	var resp WebAuthnRegisterCompleteResponse
   649  	var errors Errors
   650  
   651  	restClient := c.Start(&resp, &errors)
   652  	err := restClient.WithUri("/api/webauthn/register/complete").
   653  		WithJSONBody(request).
   654  		WithMethod(http.MethodPost).
   655  		Do(ctx)
   656  	if restClient.ErrorRef == nil {
   657  		return &resp, nil, err
   658  	}
   659  	return &resp, &errors, err
   660  }
   661  
   662  // CreateAPIKey
   663  // Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated.
   664  // an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted
   665  // to that API key.
   666  //
   667  // If an API key is locked to a tenant, it can only create API Keys for that same tenant.
   668  //
   669  //	string keyId (Optional) The unique Id of the API key. If not provided a secure random Id will be generated.
   670  //	APIKeyRequest request The request object that contains all the information needed to create the APIKey.
   671  func (c *FusionAuthClient) CreateAPIKey(keyId string, request APIKeyRequest) (*APIKeyResponse, *Errors, error) {
   672  	return c.CreateAPIKeyWithContext(context.TODO(), keyId, request)
   673  }
   674  
   675  // CreateAPIKeyWithContext
   676  // Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated.
   677  // an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted
   678  // to that API key.
   679  //
   680  // If an API key is locked to a tenant, it can only create API Keys for that same tenant.
   681  //
   682  //	string keyId (Optional) The unique Id of the API key. If not provided a secure random Id will be generated.
   683  //	APIKeyRequest request The request object that contains all the information needed to create the APIKey.
   684  func (c *FusionAuthClient) CreateAPIKeyWithContext(ctx context.Context, keyId string, request APIKeyRequest) (*APIKeyResponse, *Errors, error) {
   685  	var resp APIKeyResponse
   686  	var errors Errors
   687  
   688  	restClient := c.Start(&resp, &errors)
   689  	err := restClient.WithUri("/api/api-key").
   690  		WithUriSegment(keyId).
   691  		WithJSONBody(request).
   692  		WithMethod(http.MethodPost).
   693  		Do(ctx)
   694  	if restClient.ErrorRef == nil {
   695  		return &resp, nil, err
   696  	}
   697  	return &resp, &errors, err
   698  }
   699  
   700  // CreateApplication
   701  // Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
   702  //
   703  //	string applicationId (Optional) The Id to use for the application. If not provided a secure random UUID will be generated.
   704  //	ApplicationRequest request The request object that contains all the information used to create the application.
   705  func (c *FusionAuthClient) CreateApplication(applicationId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
   706  	return c.CreateApplicationWithContext(context.TODO(), applicationId, request)
   707  }
   708  
   709  // CreateApplicationWithContext
   710  // Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
   711  //
   712  //	string applicationId (Optional) The Id to use for the application. If not provided a secure random UUID will be generated.
   713  //	ApplicationRequest request The request object that contains all the information used to create the application.
   714  func (c *FusionAuthClient) CreateApplicationWithContext(ctx context.Context, applicationId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
   715  	var resp ApplicationResponse
   716  	var errors Errors
   717  
   718  	restClient := c.Start(&resp, &errors)
   719  	err := restClient.WithUri("/api/application").
   720  		WithUriSegment(applicationId).
   721  		WithJSONBody(request).
   722  		WithMethod(http.MethodPost).
   723  		Do(ctx)
   724  	if restClient.ErrorRef == nil {
   725  		return &resp, nil, err
   726  	}
   727  	return &resp, &errors, err
   728  }
   729  
   730  // CreateApplicationRole
   731  // Creates a new role for an application. You must specify the Id of the application you are creating the role for.
   732  // You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.
   733  //
   734  //	string applicationId The Id of the application to create the role on.
   735  //	string roleId (Optional) The Id of the role. If not provided a secure random UUID will be generated.
   736  //	ApplicationRequest request The request object that contains all the information used to create the application role.
   737  func (c *FusionAuthClient) CreateApplicationRole(applicationId string, roleId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
   738  	return c.CreateApplicationRoleWithContext(context.TODO(), applicationId, roleId, request)
   739  }
   740  
   741  // CreateApplicationRoleWithContext
   742  // Creates a new role for an application. You must specify the Id of the application you are creating the role for.
   743  // You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.
   744  //
   745  //	string applicationId The Id of the application to create the role on.
   746  //	string roleId (Optional) The Id of the role. If not provided a secure random UUID will be generated.
   747  //	ApplicationRequest request The request object that contains all the information used to create the application role.
   748  func (c *FusionAuthClient) CreateApplicationRoleWithContext(ctx context.Context, applicationId string, roleId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
   749  	var resp ApplicationResponse
   750  	var errors Errors
   751  
   752  	restClient := c.Start(&resp, &errors)
   753  	err := restClient.WithUri("/api/application").
   754  		WithUriSegment(applicationId).
   755  		WithUriSegment("role").
   756  		WithUriSegment(roleId).
   757  		WithJSONBody(request).
   758  		WithMethod(http.MethodPost).
   759  		Do(ctx)
   760  	if restClient.ErrorRef == nil {
   761  		return &resp, nil, err
   762  	}
   763  	return &resp, &errors, err
   764  }
   765  
   766  // CreateAuditLog
   767  // Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you
   768  // make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically
   769  // written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.
   770  //
   771  //	AuditLogRequest request The request object that contains all the information used to create the audit log entry.
   772  func (c *FusionAuthClient) CreateAuditLog(request AuditLogRequest) (*AuditLogResponse, *Errors, error) {
   773  	return c.CreateAuditLogWithContext(context.TODO(), request)
   774  }
   775  
   776  // CreateAuditLogWithContext
   777  // Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you
   778  // make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically
   779  // written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.
   780  //
   781  //	AuditLogRequest request The request object that contains all the information used to create the audit log entry.
   782  func (c *FusionAuthClient) CreateAuditLogWithContext(ctx context.Context, request AuditLogRequest) (*AuditLogResponse, *Errors, error) {
   783  	var resp AuditLogResponse
   784  	var errors Errors
   785  
   786  	restClient := c.Start(&resp, &errors)
   787  	err := restClient.WithUri("/api/system/audit-log").
   788  		WithJSONBody(request).
   789  		WithMethod(http.MethodPost).
   790  		Do(ctx)
   791  	if restClient.ErrorRef == nil {
   792  		return &resp, nil, err
   793  	}
   794  	return &resp, &errors, err
   795  }
   796  
   797  // CreateConnector
   798  // Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
   799  //
   800  //	string connectorId (Optional) The Id for the connector. If not provided a secure random UUID will be generated.
   801  //	ConnectorRequest request The request object that contains all the information used to create the connector.
   802  func (c *FusionAuthClient) CreateConnector(connectorId string, request ConnectorRequest) (*ConnectorResponse, *Errors, error) {
   803  	return c.CreateConnectorWithContext(context.TODO(), connectorId, request)
   804  }
   805  
   806  // CreateConnectorWithContext
   807  // Creates a connector.  You can optionally specify an Id for the connector, if not provided one will be generated.
   808  //
   809  //	string connectorId (Optional) The Id for the connector. If not provided a secure random UUID will be generated.
   810  //	ConnectorRequest request The request object that contains all the information used to create the connector.
   811  func (c *FusionAuthClient) CreateConnectorWithContext(ctx context.Context, connectorId string, request ConnectorRequest) (*ConnectorResponse, *Errors, error) {
   812  	var resp ConnectorResponse
   813  	var errors Errors
   814  
   815  	restClient := c.Start(&resp, &errors)
   816  	err := restClient.WithUri("/api/connector").
   817  		WithUriSegment(connectorId).
   818  		WithJSONBody(request).
   819  		WithMethod(http.MethodPost).
   820  		Do(ctx)
   821  	if restClient.ErrorRef == nil {
   822  		return &resp, nil, err
   823  	}
   824  	return &resp, &errors, err
   825  }
   826  
   827  // CreateConsent
   828  // Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
   829  //
   830  //	string consentId (Optional) The Id for the consent. If not provided a secure random UUID will be generated.
   831  //	ConsentRequest request The request object that contains all the information used to create the consent.
   832  func (c *FusionAuthClient) CreateConsent(consentId string, request ConsentRequest) (*ConsentResponse, *Errors, error) {
   833  	return c.CreateConsentWithContext(context.TODO(), consentId, request)
   834  }
   835  
   836  // CreateConsentWithContext
   837  // Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
   838  //
   839  //	string consentId (Optional) The Id for the consent. If not provided a secure random UUID will be generated.
   840  //	ConsentRequest request The request object that contains all the information used to create the consent.
   841  func (c *FusionAuthClient) CreateConsentWithContext(ctx context.Context, consentId string, request ConsentRequest) (*ConsentResponse, *Errors, error) {
   842  	var resp ConsentResponse
   843  	var errors Errors
   844  
   845  	restClient := c.Start(&resp, &errors)
   846  	err := restClient.WithUri("/api/consent").
   847  		WithUriSegment(consentId).
   848  		WithJSONBody(request).
   849  		WithMethod(http.MethodPost).
   850  		Do(ctx)
   851  	if restClient.ErrorRef == nil {
   852  		return &resp, nil, err
   853  	}
   854  	return &resp, &errors, err
   855  }
   856  
   857  // CreateEmailTemplate
   858  // Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
   859  //
   860  //	string emailTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
   861  //	EmailTemplateRequest request The request object that contains all the information used to create the email template.
   862  func (c *FusionAuthClient) CreateEmailTemplate(emailTemplateId string, request EmailTemplateRequest) (*EmailTemplateResponse, *Errors, error) {
   863  	return c.CreateEmailTemplateWithContext(context.TODO(), emailTemplateId, request)
   864  }
   865  
   866  // CreateEmailTemplateWithContext
   867  // Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
   868  //
   869  //	string emailTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
   870  //	EmailTemplateRequest request The request object that contains all the information used to create the email template.
   871  func (c *FusionAuthClient) CreateEmailTemplateWithContext(ctx context.Context, emailTemplateId string, request EmailTemplateRequest) (*EmailTemplateResponse, *Errors, error) {
   872  	var resp EmailTemplateResponse
   873  	var errors Errors
   874  
   875  	restClient := c.Start(&resp, &errors)
   876  	err := restClient.WithUri("/api/email/template").
   877  		WithUriSegment(emailTemplateId).
   878  		WithJSONBody(request).
   879  		WithMethod(http.MethodPost).
   880  		Do(ctx)
   881  	if restClient.ErrorRef == nil {
   882  		return &resp, nil, err
   883  	}
   884  	return &resp, &errors, err
   885  }
   886  
   887  // CreateEntity
   888  // Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
   889  //
   890  //	string entityId (Optional) The Id for the Entity. If not provided a secure random UUID will be generated.
   891  //	EntityRequest request The request object that contains all the information used to create the Entity.
   892  func (c *FusionAuthClient) CreateEntity(entityId string, request EntityRequest) (*EntityResponse, *Errors, error) {
   893  	return c.CreateEntityWithContext(context.TODO(), entityId, request)
   894  }
   895  
   896  // CreateEntityWithContext
   897  // Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
   898  //
   899  //	string entityId (Optional) The Id for the Entity. If not provided a secure random UUID will be generated.
   900  //	EntityRequest request The request object that contains all the information used to create the Entity.
   901  func (c *FusionAuthClient) CreateEntityWithContext(ctx context.Context, entityId string, request EntityRequest) (*EntityResponse, *Errors, error) {
   902  	var resp EntityResponse
   903  	var errors Errors
   904  
   905  	restClient := c.Start(&resp, &errors)
   906  	err := restClient.WithUri("/api/entity").
   907  		WithUriSegment(entityId).
   908  		WithJSONBody(request).
   909  		WithMethod(http.MethodPost).
   910  		Do(ctx)
   911  	if restClient.ErrorRef == nil {
   912  		return &resp, nil, err
   913  	}
   914  	return &resp, &errors, err
   915  }
   916  
   917  // CreateEntityType
   918  // Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
   919  //
   920  //	string entityTypeId (Optional) The Id for the Entity Type. If not provided a secure random UUID will be generated.
   921  //	EntityTypeRequest request The request object that contains all the information used to create the Entity Type.
   922  func (c *FusionAuthClient) CreateEntityType(entityTypeId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
   923  	return c.CreateEntityTypeWithContext(context.TODO(), entityTypeId, request)
   924  }
   925  
   926  // CreateEntityTypeWithContext
   927  // Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
   928  //
   929  //	string entityTypeId (Optional) The Id for the Entity Type. If not provided a secure random UUID will be generated.
   930  //	EntityTypeRequest request The request object that contains all the information used to create the Entity Type.
   931  func (c *FusionAuthClient) CreateEntityTypeWithContext(ctx context.Context, entityTypeId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
   932  	var resp EntityTypeResponse
   933  	var errors Errors
   934  
   935  	restClient := c.Start(&resp, &errors)
   936  	err := restClient.WithUri("/api/entity/type").
   937  		WithUriSegment(entityTypeId).
   938  		WithJSONBody(request).
   939  		WithMethod(http.MethodPost).
   940  		Do(ctx)
   941  	if restClient.ErrorRef == nil {
   942  		return &resp, nil, err
   943  	}
   944  	return &resp, &errors, err
   945  }
   946  
   947  // CreateEntityTypePermission
   948  // Creates a new permission for an entity type. You must specify the Id of the entity type you are creating the permission for.
   949  // You can optionally specify an Id for the permission inside the EntityTypePermission object itself, if not provided one will be generated.
   950  //
   951  //	string entityTypeId The Id of the entity type to create the permission on.
   952  //	string permissionId (Optional) The Id of the permission. If not provided a secure random UUID will be generated.
   953  //	EntityTypeRequest request The request object that contains all the information used to create the permission.
   954  func (c *FusionAuthClient) CreateEntityTypePermission(entityTypeId string, permissionId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
   955  	return c.CreateEntityTypePermissionWithContext(context.TODO(), entityTypeId, permissionId, request)
   956  }
   957  
   958  // CreateEntityTypePermissionWithContext
   959  // Creates a new permission for an entity type. You must specify the Id of the entity type you are creating the permission for.
   960  // You can optionally specify an Id for the permission inside the EntityTypePermission object itself, if not provided one will be generated.
   961  //
   962  //	string entityTypeId The Id of the entity type to create the permission on.
   963  //	string permissionId (Optional) The Id of the permission. If not provided a secure random UUID will be generated.
   964  //	EntityTypeRequest request The request object that contains all the information used to create the permission.
   965  func (c *FusionAuthClient) CreateEntityTypePermissionWithContext(ctx context.Context, entityTypeId string, permissionId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
   966  	var resp EntityTypeResponse
   967  	var errors Errors
   968  
   969  	restClient := c.Start(&resp, &errors)
   970  	err := restClient.WithUri("/api/entity/type").
   971  		WithUriSegment(entityTypeId).
   972  		WithUriSegment("permission").
   973  		WithUriSegment(permissionId).
   974  		WithJSONBody(request).
   975  		WithMethod(http.MethodPost).
   976  		Do(ctx)
   977  	if restClient.ErrorRef == nil {
   978  		return &resp, nil, err
   979  	}
   980  	return &resp, &errors, err
   981  }
   982  
   983  // CreateFamily
   984  // Creates a family with the user Id in the request as the owner and sole member of the family. You can optionally specify an Id for the
   985  // family, if not provided one will be generated.
   986  //
   987  //	string familyId (Optional) The Id for the family. If not provided a secure random UUID will be generated.
   988  //	FamilyRequest request The request object that contains all the information used to create the family.
   989  func (c *FusionAuthClient) CreateFamily(familyId string, request FamilyRequest) (*FamilyResponse, *Errors, error) {
   990  	return c.CreateFamilyWithContext(context.TODO(), familyId, request)
   991  }
   992  
   993  // CreateFamilyWithContext
   994  // Creates a family with the user Id in the request as the owner and sole member of the family. You can optionally specify an Id for the
   995  // family, if not provided one will be generated.
   996  //
   997  //	string familyId (Optional) The Id for the family. If not provided a secure random UUID will be generated.
   998  //	FamilyRequest request The request object that contains all the information used to create the family.
   999  func (c *FusionAuthClient) CreateFamilyWithContext(ctx context.Context, familyId string, request FamilyRequest) (*FamilyResponse, *Errors, error) {
  1000  	var resp FamilyResponse
  1001  	var errors Errors
  1002  
  1003  	restClient := c.Start(&resp, &errors)
  1004  	err := restClient.WithUri("/api/user/family").
  1005  		WithUriSegment(familyId).
  1006  		WithJSONBody(request).
  1007  		WithMethod(http.MethodPost).
  1008  		Do(ctx)
  1009  	if restClient.ErrorRef == nil {
  1010  		return &resp, nil, err
  1011  	}
  1012  	return &resp, &errors, err
  1013  }
  1014  
  1015  // CreateForm
  1016  // Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
  1017  //
  1018  //	string formId (Optional) The Id for the form. If not provided a secure random UUID will be generated.
  1019  //	FormRequest request The request object that contains all the information used to create the form.
  1020  func (c *FusionAuthClient) CreateForm(formId string, request FormRequest) (*FormResponse, *Errors, error) {
  1021  	return c.CreateFormWithContext(context.TODO(), formId, request)
  1022  }
  1023  
  1024  // CreateFormWithContext
  1025  // Creates a form.  You can optionally specify an Id for the form, if not provided one will be generated.
  1026  //
  1027  //	string formId (Optional) The Id for the form. If not provided a secure random UUID will be generated.
  1028  //	FormRequest request The request object that contains all the information used to create the form.
  1029  func (c *FusionAuthClient) CreateFormWithContext(ctx context.Context, formId string, request FormRequest) (*FormResponse, *Errors, error) {
  1030  	var resp FormResponse
  1031  	var errors Errors
  1032  
  1033  	restClient := c.Start(&resp, &errors)
  1034  	err := restClient.WithUri("/api/form").
  1035  		WithUriSegment(formId).
  1036  		WithJSONBody(request).
  1037  		WithMethod(http.MethodPost).
  1038  		Do(ctx)
  1039  	if restClient.ErrorRef == nil {
  1040  		return &resp, nil, err
  1041  	}
  1042  	return &resp, &errors, err
  1043  }
  1044  
  1045  // CreateFormField
  1046  // Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
  1047  //
  1048  //	string fieldId (Optional) The Id for the form field. If not provided a secure random UUID will be generated.
  1049  //	FormFieldRequest request The request object that contains all the information used to create the form field.
  1050  func (c *FusionAuthClient) CreateFormField(fieldId string, request FormFieldRequest) (*FormFieldResponse, *Errors, error) {
  1051  	return c.CreateFormFieldWithContext(context.TODO(), fieldId, request)
  1052  }
  1053  
  1054  // CreateFormFieldWithContext
  1055  // Creates a form field.  You can optionally specify an Id for the form, if not provided one will be generated.
  1056  //
  1057  //	string fieldId (Optional) The Id for the form field. If not provided a secure random UUID will be generated.
  1058  //	FormFieldRequest request The request object that contains all the information used to create the form field.
  1059  func (c *FusionAuthClient) CreateFormFieldWithContext(ctx context.Context, fieldId string, request FormFieldRequest) (*FormFieldResponse, *Errors, error) {
  1060  	var resp FormFieldResponse
  1061  	var errors Errors
  1062  
  1063  	restClient := c.Start(&resp, &errors)
  1064  	err := restClient.WithUri("/api/form/field").
  1065  		WithUriSegment(fieldId).
  1066  		WithJSONBody(request).
  1067  		WithMethod(http.MethodPost).
  1068  		Do(ctx)
  1069  	if restClient.ErrorRef == nil {
  1070  		return &resp, nil, err
  1071  	}
  1072  	return &resp, &errors, err
  1073  }
  1074  
  1075  // CreateGroup
  1076  // Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
  1077  //
  1078  //	string groupId (Optional) The Id for the group. If not provided a secure random UUID will be generated.
  1079  //	GroupRequest request The request object that contains all the information used to create the group.
  1080  func (c *FusionAuthClient) CreateGroup(groupId string, request GroupRequest) (*GroupResponse, *Errors, error) {
  1081  	return c.CreateGroupWithContext(context.TODO(), groupId, request)
  1082  }
  1083  
  1084  // CreateGroupWithContext
  1085  // Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
  1086  //
  1087  //	string groupId (Optional) The Id for the group. If not provided a secure random UUID will be generated.
  1088  //	GroupRequest request The request object that contains all the information used to create the group.
  1089  func (c *FusionAuthClient) CreateGroupWithContext(ctx context.Context, groupId string, request GroupRequest) (*GroupResponse, *Errors, error) {
  1090  	var resp GroupResponse
  1091  	var errors Errors
  1092  
  1093  	restClient := c.Start(&resp, &errors)
  1094  	err := restClient.WithUri("/api/group").
  1095  		WithUriSegment(groupId).
  1096  		WithJSONBody(request).
  1097  		WithMethod(http.MethodPost).
  1098  		Do(ctx)
  1099  	if restClient.ErrorRef == nil {
  1100  		return &resp, nil, err
  1101  	}
  1102  	return &resp, &errors, err
  1103  }
  1104  
  1105  // CreateGroupMembers
  1106  // Creates a member in a group.
  1107  //
  1108  //	MemberRequest request The request object that contains all the information used to create the group member(s).
  1109  func (c *FusionAuthClient) CreateGroupMembers(request MemberRequest) (*MemberResponse, *Errors, error) {
  1110  	return c.CreateGroupMembersWithContext(context.TODO(), request)
  1111  }
  1112  
  1113  // CreateGroupMembersWithContext
  1114  // Creates a member in a group.
  1115  //
  1116  //	MemberRequest request The request object that contains all the information used to create the group member(s).
  1117  func (c *FusionAuthClient) CreateGroupMembersWithContext(ctx context.Context, request MemberRequest) (*MemberResponse, *Errors, error) {
  1118  	var resp MemberResponse
  1119  	var errors Errors
  1120  
  1121  	restClient := c.Start(&resp, &errors)
  1122  	err := restClient.WithUri("/api/group/member").
  1123  		WithJSONBody(request).
  1124  		WithMethod(http.MethodPost).
  1125  		Do(ctx)
  1126  	if restClient.ErrorRef == nil {
  1127  		return &resp, nil, err
  1128  	}
  1129  	return &resp, &errors, err
  1130  }
  1131  
  1132  // CreateIPAccessControlList
  1133  // Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.
  1134  //
  1135  //	string accessControlListId (Optional) The Id for the IP Access Control List. If not provided a secure random UUID will be generated.
  1136  //	IPAccessControlListRequest request The request object that contains all the information used to create the IP Access Control List.
  1137  func (c *FusionAuthClient) CreateIPAccessControlList(accessControlListId string, request IPAccessControlListRequest) (*IPAccessControlListResponse, *Errors, error) {
  1138  	return c.CreateIPAccessControlListWithContext(context.TODO(), accessControlListId, request)
  1139  }
  1140  
  1141  // CreateIPAccessControlListWithContext
  1142  // Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.
  1143  //
  1144  //	string accessControlListId (Optional) The Id for the IP Access Control List. If not provided a secure random UUID will be generated.
  1145  //	IPAccessControlListRequest request The request object that contains all the information used to create the IP Access Control List.
  1146  func (c *FusionAuthClient) CreateIPAccessControlListWithContext(ctx context.Context, accessControlListId string, request IPAccessControlListRequest) (*IPAccessControlListResponse, *Errors, error) {
  1147  	var resp IPAccessControlListResponse
  1148  	var errors Errors
  1149  
  1150  	restClient := c.Start(&resp, &errors)
  1151  	err := restClient.WithUri("/api/ip-acl").
  1152  		WithUriSegment(accessControlListId).
  1153  		WithJSONBody(request).
  1154  		WithMethod(http.MethodPost).
  1155  		Do(ctx)
  1156  	if restClient.ErrorRef == nil {
  1157  		return &resp, nil, err
  1158  	}
  1159  	return &resp, &errors, err
  1160  }
  1161  
  1162  // CreateLambda
  1163  // Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
  1164  //
  1165  //	string lambdaId (Optional) The Id for the lambda. If not provided a secure random UUID will be generated.
  1166  //	LambdaRequest request The request object that contains all the information used to create the lambda.
  1167  func (c *FusionAuthClient) CreateLambda(lambdaId string, request LambdaRequest) (*LambdaResponse, *Errors, error) {
  1168  	return c.CreateLambdaWithContext(context.TODO(), lambdaId, request)
  1169  }
  1170  
  1171  // CreateLambdaWithContext
  1172  // Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
  1173  //
  1174  //	string lambdaId (Optional) The Id for the lambda. If not provided a secure random UUID will be generated.
  1175  //	LambdaRequest request The request object that contains all the information used to create the lambda.
  1176  func (c *FusionAuthClient) CreateLambdaWithContext(ctx context.Context, lambdaId string, request LambdaRequest) (*LambdaResponse, *Errors, error) {
  1177  	var resp LambdaResponse
  1178  	var errors Errors
  1179  
  1180  	restClient := c.Start(&resp, &errors)
  1181  	err := restClient.WithUri("/api/lambda").
  1182  		WithUriSegment(lambdaId).
  1183  		WithJSONBody(request).
  1184  		WithMethod(http.MethodPost).
  1185  		Do(ctx)
  1186  	if restClient.ErrorRef == nil {
  1187  		return &resp, nil, err
  1188  	}
  1189  	return &resp, &errors, err
  1190  }
  1191  
  1192  // CreateMessageTemplate
  1193  // Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
  1194  //
  1195  //	string messageTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
  1196  //	MessageTemplateRequest request The request object that contains all the information used to create the message template.
  1197  func (c *FusionAuthClient) CreateMessageTemplate(messageTemplateId string, request MessageTemplateRequest) (*MessageTemplateResponse, *Errors, error) {
  1198  	return c.CreateMessageTemplateWithContext(context.TODO(), messageTemplateId, request)
  1199  }
  1200  
  1201  // CreateMessageTemplateWithContext
  1202  // Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
  1203  //
  1204  //	string messageTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
  1205  //	MessageTemplateRequest request The request object that contains all the information used to create the message template.
  1206  func (c *FusionAuthClient) CreateMessageTemplateWithContext(ctx context.Context, messageTemplateId string, request MessageTemplateRequest) (*MessageTemplateResponse, *Errors, error) {
  1207  	var resp MessageTemplateResponse
  1208  	var errors Errors
  1209  
  1210  	restClient := c.Start(&resp, &errors)
  1211  	err := restClient.WithUri("/api/message/template").
  1212  		WithUriSegment(messageTemplateId).
  1213  		WithJSONBody(request).
  1214  		WithMethod(http.MethodPost).
  1215  		Do(ctx)
  1216  	if restClient.ErrorRef == nil {
  1217  		return &resp, nil, err
  1218  	}
  1219  	return &resp, &errors, err
  1220  }
  1221  
  1222  // CreateMessenger
  1223  // Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
  1224  //
  1225  //	string messengerId (Optional) The Id for the messenger. If not provided a secure random UUID will be generated.
  1226  //	MessengerRequest request The request object that contains all the information used to create the messenger.
  1227  func (c *FusionAuthClient) CreateMessenger(messengerId string, request MessengerRequest) (*MessengerResponse, *Errors, error) {
  1228  	return c.CreateMessengerWithContext(context.TODO(), messengerId, request)
  1229  }
  1230  
  1231  // CreateMessengerWithContext
  1232  // Creates a messenger.  You can optionally specify an Id for the messenger, if not provided one will be generated.
  1233  //
  1234  //	string messengerId (Optional) The Id for the messenger. If not provided a secure random UUID will be generated.
  1235  //	MessengerRequest request The request object that contains all the information used to create the messenger.
  1236  func (c *FusionAuthClient) CreateMessengerWithContext(ctx context.Context, messengerId string, request MessengerRequest) (*MessengerResponse, *Errors, error) {
  1237  	var resp MessengerResponse
  1238  	var errors Errors
  1239  
  1240  	restClient := c.Start(&resp, &errors)
  1241  	err := restClient.WithUri("/api/messenger").
  1242  		WithUriSegment(messengerId).
  1243  		WithJSONBody(request).
  1244  		WithMethod(http.MethodPost).
  1245  		Do(ctx)
  1246  	if restClient.ErrorRef == nil {
  1247  		return &resp, nil, err
  1248  	}
  1249  	return &resp, &errors, err
  1250  }
  1251  
  1252  // CreateOAuthScope
  1253  // Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for.
  1254  // You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
  1255  //
  1256  //	string applicationId The Id of the application to create the OAuth scope on.
  1257  //	string scopeId (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
  1258  //	ApplicationOAuthScopeRequest request The request object that contains all the information used to create the OAuth OAuth scope.
  1259  func (c *FusionAuthClient) CreateOAuthScope(applicationId string, scopeId string, request ApplicationOAuthScopeRequest) (*ApplicationOAuthScopeResponse, *Errors, error) {
  1260  	return c.CreateOAuthScopeWithContext(context.TODO(), applicationId, scopeId, request)
  1261  }
  1262  
  1263  // CreateOAuthScopeWithContext
  1264  // Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for.
  1265  // You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
  1266  //
  1267  //	string applicationId The Id of the application to create the OAuth scope on.
  1268  //	string scopeId (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
  1269  //	ApplicationOAuthScopeRequest request The request object that contains all the information used to create the OAuth OAuth scope.
  1270  func (c *FusionAuthClient) CreateOAuthScopeWithContext(ctx context.Context, applicationId string, scopeId string, request ApplicationOAuthScopeRequest) (*ApplicationOAuthScopeResponse, *Errors, error) {
  1271  	var resp ApplicationOAuthScopeResponse
  1272  	var errors Errors
  1273  
  1274  	restClient := c.Start(&resp, &errors)
  1275  	err := restClient.WithUri("/api/application").
  1276  		WithUriSegment(applicationId).
  1277  		WithUriSegment("scope").
  1278  		WithUriSegment(scopeId).
  1279  		WithJSONBody(request).
  1280  		WithMethod(http.MethodPost).
  1281  		Do(ctx)
  1282  	if restClient.ErrorRef == nil {
  1283  		return &resp, nil, err
  1284  	}
  1285  	return &resp, &errors, err
  1286  }
  1287  
  1288  // CreateTenant
  1289  // Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
  1290  //
  1291  //	string tenantId (Optional) The Id for the tenant. If not provided a secure random UUID will be generated.
  1292  //	TenantRequest request The request object that contains all the information used to create the tenant.
  1293  func (c *FusionAuthClient) CreateTenant(tenantId string, request TenantRequest) (*TenantResponse, *Errors, error) {
  1294  	return c.CreateTenantWithContext(context.TODO(), tenantId, request)
  1295  }
  1296  
  1297  // CreateTenantWithContext
  1298  // Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
  1299  //
  1300  //	string tenantId (Optional) The Id for the tenant. If not provided a secure random UUID will be generated.
  1301  //	TenantRequest request The request object that contains all the information used to create the tenant.
  1302  func (c *FusionAuthClient) CreateTenantWithContext(ctx context.Context, tenantId string, request TenantRequest) (*TenantResponse, *Errors, error) {
  1303  	var resp TenantResponse
  1304  	var errors Errors
  1305  
  1306  	restClient := c.Start(&resp, &errors)
  1307  	err := restClient.WithUri("/api/tenant").
  1308  		WithUriSegment(tenantId).
  1309  		WithJSONBody(request).
  1310  		WithMethod(http.MethodPost).
  1311  		Do(ctx)
  1312  	if restClient.ErrorRef == nil {
  1313  		return &resp, nil, err
  1314  	}
  1315  	return &resp, &errors, err
  1316  }
  1317  
  1318  // CreateTheme
  1319  // Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
  1320  //
  1321  //	string themeId (Optional) The Id for the theme. If not provided a secure random UUID will be generated.
  1322  //	ThemeRequest request The request object that contains all the information used to create the theme.
  1323  func (c *FusionAuthClient) CreateTheme(themeId string, request ThemeRequest) (*ThemeResponse, *Errors, error) {
  1324  	return c.CreateThemeWithContext(context.TODO(), themeId, request)
  1325  }
  1326  
  1327  // CreateThemeWithContext
  1328  // Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
  1329  //
  1330  //	string themeId (Optional) The Id for the theme. If not provided a secure random UUID will be generated.
  1331  //	ThemeRequest request The request object that contains all the information used to create the theme.
  1332  func (c *FusionAuthClient) CreateThemeWithContext(ctx context.Context, themeId string, request ThemeRequest) (*ThemeResponse, *Errors, error) {
  1333  	var resp ThemeResponse
  1334  	var errors Errors
  1335  
  1336  	restClient := c.Start(&resp, &errors)
  1337  	err := restClient.WithUri("/api/theme").
  1338  		WithUriSegment(themeId).
  1339  		WithJSONBody(request).
  1340  		WithMethod(http.MethodPost).
  1341  		Do(ctx)
  1342  	if restClient.ErrorRef == nil {
  1343  		return &resp, nil, err
  1344  	}
  1345  	return &resp, &errors, err
  1346  }
  1347  
  1348  // CreateUser
  1349  // Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
  1350  //
  1351  //	string userId (Optional) The Id for the user. If not provided a secure random UUID will be generated.
  1352  //	UserRequest request The request object that contains all the information used to create the user.
  1353  func (c *FusionAuthClient) CreateUser(userId string, request UserRequest) (*UserResponse, *Errors, error) {
  1354  	return c.CreateUserWithContext(context.TODO(), userId, request)
  1355  }
  1356  
  1357  // CreateUserWithContext
  1358  // Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
  1359  //
  1360  //	string userId (Optional) The Id for the user. If not provided a secure random UUID will be generated.
  1361  //	UserRequest request The request object that contains all the information used to create the user.
  1362  func (c *FusionAuthClient) CreateUserWithContext(ctx context.Context, userId string, request UserRequest) (*UserResponse, *Errors, error) {
  1363  	var resp UserResponse
  1364  	var errors Errors
  1365  
  1366  	restClient := c.Start(&resp, &errors)
  1367  	err := restClient.WithUri("/api/user").
  1368  		WithUriSegment(userId).
  1369  		WithJSONBody(request).
  1370  		WithMethod(http.MethodPost).
  1371  		Do(ctx)
  1372  	if restClient.ErrorRef == nil {
  1373  		return &resp, nil, err
  1374  	}
  1375  	return &resp, &errors, err
  1376  }
  1377  
  1378  // CreateUserAction
  1379  // Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after
  1380  // that the user action can be applied to any user.
  1381  //
  1382  //	string userActionId (Optional) The Id for the user action. If not provided a secure random UUID will be generated.
  1383  //	UserActionRequest request The request object that contains all the information used to create the user action.
  1384  func (c *FusionAuthClient) CreateUserAction(userActionId string, request UserActionRequest) (*UserActionResponse, *Errors, error) {
  1385  	return c.CreateUserActionWithContext(context.TODO(), userActionId, request)
  1386  }
  1387  
  1388  // CreateUserActionWithContext
  1389  // Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after
  1390  // that the user action can be applied to any user.
  1391  //
  1392  //	string userActionId (Optional) The Id for the user action. If not provided a secure random UUID will be generated.
  1393  //	UserActionRequest request The request object that contains all the information used to create the user action.
  1394  func (c *FusionAuthClient) CreateUserActionWithContext(ctx context.Context, userActionId string, request UserActionRequest) (*UserActionResponse, *Errors, error) {
  1395  	var resp UserActionResponse
  1396  	var errors Errors
  1397  
  1398  	restClient := c.Start(&resp, &errors)
  1399  	err := restClient.WithUri("/api/user-action").
  1400  		WithUriSegment(userActionId).
  1401  		WithJSONBody(request).
  1402  		WithMethod(http.MethodPost).
  1403  		Do(ctx)
  1404  	if restClient.ErrorRef == nil {
  1405  		return &resp, nil, err
  1406  	}
  1407  	return &resp, &errors, err
  1408  }
  1409  
  1410  // CreateUserActionReason
  1411  // Creates a user reason. This user action reason cannot be used when actioning a user until this call completes
  1412  // successfully. Anytime after that the user action reason can be used.
  1413  //
  1414  //	string userActionReasonId (Optional) The Id for the user action reason. If not provided a secure random UUID will be generated.
  1415  //	UserActionReasonRequest request The request object that contains all the information used to create the user action reason.
  1416  func (c *FusionAuthClient) CreateUserActionReason(userActionReasonId string, request UserActionReasonRequest) (*UserActionReasonResponse, *Errors, error) {
  1417  	return c.CreateUserActionReasonWithContext(context.TODO(), userActionReasonId, request)
  1418  }
  1419  
  1420  // CreateUserActionReasonWithContext
  1421  // Creates a user reason. This user action reason cannot be used when actioning a user until this call completes
  1422  // successfully. Anytime after that the user action reason can be used.
  1423  //
  1424  //	string userActionReasonId (Optional) The Id for the user action reason. If not provided a secure random UUID will be generated.
  1425  //	UserActionReasonRequest request The request object that contains all the information used to create the user action reason.
  1426  func (c *FusionAuthClient) CreateUserActionReasonWithContext(ctx context.Context, userActionReasonId string, request UserActionReasonRequest) (*UserActionReasonResponse, *Errors, error) {
  1427  	var resp UserActionReasonResponse
  1428  	var errors Errors
  1429  
  1430  	restClient := c.Start(&resp, &errors)
  1431  	err := restClient.WithUri("/api/user-action-reason").
  1432  		WithUriSegment(userActionReasonId).
  1433  		WithJSONBody(request).
  1434  		WithMethod(http.MethodPost).
  1435  		Do(ctx)
  1436  	if restClient.ErrorRef == nil {
  1437  		return &resp, nil, err
  1438  	}
  1439  	return &resp, &errors, err
  1440  }
  1441  
  1442  // CreateUserConsent
  1443  // Creates a single User consent.
  1444  //
  1445  //	string userConsentId (Optional) The Id for the User consent. If not provided a secure random UUID will be generated.
  1446  //	UserConsentRequest request The request that contains the user consent information.
  1447  func (c *FusionAuthClient) CreateUserConsent(userConsentId string, request UserConsentRequest) (*UserConsentResponse, *Errors, error) {
  1448  	return c.CreateUserConsentWithContext(context.TODO(), userConsentId, request)
  1449  }
  1450  
  1451  // CreateUserConsentWithContext
  1452  // Creates a single User consent.
  1453  //
  1454  //	string userConsentId (Optional) The Id for the User consent. If not provided a secure random UUID will be generated.
  1455  //	UserConsentRequest request The request that contains the user consent information.
  1456  func (c *FusionAuthClient) CreateUserConsentWithContext(ctx context.Context, userConsentId string, request UserConsentRequest) (*UserConsentResponse, *Errors, error) {
  1457  	var resp UserConsentResponse
  1458  	var errors Errors
  1459  
  1460  	restClient := c.Start(&resp, &errors)
  1461  	err := restClient.WithUri("/api/user/consent").
  1462  		WithUriSegment(userConsentId).
  1463  		WithJSONBody(request).
  1464  		WithMethod(http.MethodPost).
  1465  		Do(ctx)
  1466  	if restClient.ErrorRef == nil {
  1467  		return &resp, nil, err
  1468  	}
  1469  	return &resp, &errors, err
  1470  }
  1471  
  1472  // CreateUserLink
  1473  // Link an external user from a 3rd party identity provider to a FusionAuth user.
  1474  //
  1475  //	IdentityProviderLinkRequest request The request object that contains all the information used to link the FusionAuth user.
  1476  func (c *FusionAuthClient) CreateUserLink(request IdentityProviderLinkRequest) (*IdentityProviderLinkResponse, *Errors, error) {
  1477  	return c.CreateUserLinkWithContext(context.TODO(), request)
  1478  }
  1479  
  1480  // CreateUserLinkWithContext
  1481  // Link an external user from a 3rd party identity provider to a FusionAuth user.
  1482  //
  1483  //	IdentityProviderLinkRequest request The request object that contains all the information used to link the FusionAuth user.
  1484  func (c *FusionAuthClient) CreateUserLinkWithContext(ctx context.Context, request IdentityProviderLinkRequest) (*IdentityProviderLinkResponse, *Errors, error) {
  1485  	var resp IdentityProviderLinkResponse
  1486  	var errors Errors
  1487  
  1488  	restClient := c.Start(&resp, &errors)
  1489  	err := restClient.WithUri("/api/identity-provider/link").
  1490  		WithJSONBody(request).
  1491  		WithMethod(http.MethodPost).
  1492  		Do(ctx)
  1493  	if restClient.ErrorRef == nil {
  1494  		return &resp, nil, err
  1495  	}
  1496  	return &resp, &errors, err
  1497  }
  1498  
  1499  // CreateWebhook
  1500  // Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
  1501  //
  1502  //	string webhookId (Optional) The Id for the webhook. If not provided a secure random UUID will be generated.
  1503  //	WebhookRequest request The request object that contains all the information used to create the webhook.
  1504  func (c *FusionAuthClient) CreateWebhook(webhookId string, request WebhookRequest) (*WebhookResponse, *Errors, error) {
  1505  	return c.CreateWebhookWithContext(context.TODO(), webhookId, request)
  1506  }
  1507  
  1508  // CreateWebhookWithContext
  1509  // Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
  1510  //
  1511  //	string webhookId (Optional) The Id for the webhook. If not provided a secure random UUID will be generated.
  1512  //	WebhookRequest request The request object that contains all the information used to create the webhook.
  1513  func (c *FusionAuthClient) CreateWebhookWithContext(ctx context.Context, webhookId string, request WebhookRequest) (*WebhookResponse, *Errors, error) {
  1514  	var resp WebhookResponse
  1515  	var errors Errors
  1516  
  1517  	restClient := c.Start(&resp, &errors)
  1518  	err := restClient.WithUri("/api/webhook").
  1519  		WithUriSegment(webhookId).
  1520  		WithJSONBody(request).
  1521  		WithMethod(http.MethodPost).
  1522  		Do(ctx)
  1523  	if restClient.ErrorRef == nil {
  1524  		return &resp, nil, err
  1525  	}
  1526  	return &resp, &errors, err
  1527  }
  1528  
  1529  // DeactivateApplication
  1530  // Deactivates the application with the given Id.
  1531  //
  1532  //	string applicationId The Id of the application to deactivate.
  1533  func (c *FusionAuthClient) DeactivateApplication(applicationId string) (*BaseHTTPResponse, *Errors, error) {
  1534  	return c.DeactivateApplicationWithContext(context.TODO(), applicationId)
  1535  }
  1536  
  1537  // DeactivateApplicationWithContext
  1538  // Deactivates the application with the given Id.
  1539  //
  1540  //	string applicationId The Id of the application to deactivate.
  1541  func (c *FusionAuthClient) DeactivateApplicationWithContext(ctx context.Context, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  1542  	var resp BaseHTTPResponse
  1543  	var errors Errors
  1544  
  1545  	restClient := c.Start(&resp, &errors)
  1546  	err := restClient.WithUri("/api/application").
  1547  		WithUriSegment(applicationId).
  1548  		WithMethod(http.MethodDelete).
  1549  		Do(ctx)
  1550  	if restClient.ErrorRef == nil {
  1551  		return &resp, nil, err
  1552  	}
  1553  	return &resp, &errors, err
  1554  }
  1555  
  1556  // DeactivateReactor
  1557  // Deactivates the FusionAuth Reactor.
  1558  func (c *FusionAuthClient) DeactivateReactor() (*BaseHTTPResponse, error) {
  1559  	return c.DeactivateReactorWithContext(context.TODO())
  1560  }
  1561  
  1562  // DeactivateReactorWithContext
  1563  // Deactivates the FusionAuth Reactor.
  1564  func (c *FusionAuthClient) DeactivateReactorWithContext(ctx context.Context) (*BaseHTTPResponse, error) {
  1565  	var resp BaseHTTPResponse
  1566  
  1567  	err := c.Start(&resp, nil).
  1568  		WithUri("/api/reactor").
  1569  		WithMethod(http.MethodDelete).
  1570  		Do(ctx)
  1571  	return &resp, err
  1572  }
  1573  
  1574  // DeactivateUser
  1575  // Deactivates the user with the given Id.
  1576  //
  1577  //	string userId The Id of the user to deactivate.
  1578  func (c *FusionAuthClient) DeactivateUser(userId string) (*BaseHTTPResponse, *Errors, error) {
  1579  	return c.DeactivateUserWithContext(context.TODO(), userId)
  1580  }
  1581  
  1582  // DeactivateUserWithContext
  1583  // Deactivates the user with the given Id.
  1584  //
  1585  //	string userId The Id of the user to deactivate.
  1586  func (c *FusionAuthClient) DeactivateUserWithContext(ctx context.Context, userId string) (*BaseHTTPResponse, *Errors, error) {
  1587  	var resp BaseHTTPResponse
  1588  	var errors Errors
  1589  
  1590  	restClient := c.Start(&resp, &errors)
  1591  	err := restClient.WithUri("/api/user").
  1592  		WithUriSegment(userId).
  1593  		WithMethod(http.MethodDelete).
  1594  		Do(ctx)
  1595  	if restClient.ErrorRef == nil {
  1596  		return &resp, nil, err
  1597  	}
  1598  	return &resp, &errors, err
  1599  }
  1600  
  1601  // DeactivateUserAction
  1602  // Deactivates the user action with the given Id.
  1603  //
  1604  //	string userActionId The Id of the user action to deactivate.
  1605  func (c *FusionAuthClient) DeactivateUserAction(userActionId string) (*BaseHTTPResponse, *Errors, error) {
  1606  	return c.DeactivateUserActionWithContext(context.TODO(), userActionId)
  1607  }
  1608  
  1609  // DeactivateUserActionWithContext
  1610  // Deactivates the user action with the given Id.
  1611  //
  1612  //	string userActionId The Id of the user action to deactivate.
  1613  func (c *FusionAuthClient) DeactivateUserActionWithContext(ctx context.Context, userActionId string) (*BaseHTTPResponse, *Errors, error) {
  1614  	var resp BaseHTTPResponse
  1615  	var errors Errors
  1616  
  1617  	restClient := c.Start(&resp, &errors)
  1618  	err := restClient.WithUri("/api/user-action").
  1619  		WithUriSegment(userActionId).
  1620  		WithMethod(http.MethodDelete).
  1621  		Do(ctx)
  1622  	if restClient.ErrorRef == nil {
  1623  		return &resp, nil, err
  1624  	}
  1625  	return &resp, &errors, err
  1626  }
  1627  
  1628  // DeactivateUsers
  1629  // Deactivates the users with the given ids.
  1630  //
  1631  //	[]string userIds The ids of the users to deactivate.
  1632  //
  1633  // Deprecated: This method has been renamed to DeactivateUsersByIds, use that method instead.
  1634  func (c *FusionAuthClient) DeactivateUsers(userIds []string) (*UserDeleteResponse, *Errors, error) {
  1635  	return c.DeactivateUsersWithContext(context.TODO(), userIds)
  1636  }
  1637  
  1638  // DeactivateUsersWithContext
  1639  // Deactivates the users with the given ids.
  1640  //
  1641  //	[]string userIds The ids of the users to deactivate.
  1642  //
  1643  // Deprecated: This method has been renamed to DeactivateUsersByIdsWithContext, use that method instead.
  1644  func (c *FusionAuthClient) DeactivateUsersWithContext(ctx context.Context, userIds []string) (*UserDeleteResponse, *Errors, error) {
  1645  	var resp UserDeleteResponse
  1646  	var errors Errors
  1647  
  1648  	restClient := c.Start(&resp, &errors)
  1649  	err := restClient.WithUri("/api/user/bulk").
  1650  		WithParameter("userId", userIds).
  1651  		WithParameter("dryRun", strconv.FormatBool(false)).
  1652  		WithParameter("hardDelete", strconv.FormatBool(false)).
  1653  		WithMethod(http.MethodDelete).
  1654  		Do(ctx)
  1655  	if restClient.ErrorRef == nil {
  1656  		return &resp, nil, err
  1657  	}
  1658  	return &resp, &errors, err
  1659  }
  1660  
  1661  // DeactivateUsersByIds
  1662  // Deactivates the users with the given ids.
  1663  //
  1664  //	[]string userIds The ids of the users to deactivate.
  1665  func (c *FusionAuthClient) DeactivateUsersByIds(userIds []string) (*UserDeleteResponse, *Errors, error) {
  1666  	return c.DeactivateUsersByIdsWithContext(context.TODO(), userIds)
  1667  }
  1668  
  1669  // DeactivateUsersByIdsWithContext
  1670  // Deactivates the users with the given ids.
  1671  //
  1672  //	[]string userIds The ids of the users to deactivate.
  1673  func (c *FusionAuthClient) DeactivateUsersByIdsWithContext(ctx context.Context, userIds []string) (*UserDeleteResponse, *Errors, error) {
  1674  	var resp UserDeleteResponse
  1675  	var errors Errors
  1676  
  1677  	restClient := c.Start(&resp, &errors)
  1678  	err := restClient.WithUri("/api/user/bulk").
  1679  		WithParameter("userId", userIds).
  1680  		WithParameter("dryRun", strconv.FormatBool(false)).
  1681  		WithParameter("hardDelete", strconv.FormatBool(false)).
  1682  		WithMethod(http.MethodDelete).
  1683  		Do(ctx)
  1684  	if restClient.ErrorRef == nil {
  1685  		return &resp, nil, err
  1686  	}
  1687  	return &resp, &errors, err
  1688  }
  1689  
  1690  // DeleteAPIKey
  1691  // Deletes the API key for the given Id.
  1692  //
  1693  //	string keyId The Id of the authentication API key to delete.
  1694  func (c *FusionAuthClient) DeleteAPIKey(keyId string) (*BaseHTTPResponse, *Errors, error) {
  1695  	return c.DeleteAPIKeyWithContext(context.TODO(), keyId)
  1696  }
  1697  
  1698  // DeleteAPIKeyWithContext
  1699  // Deletes the API key for the given Id.
  1700  //
  1701  //	string keyId The Id of the authentication API key to delete.
  1702  func (c *FusionAuthClient) DeleteAPIKeyWithContext(ctx context.Context, keyId string) (*BaseHTTPResponse, *Errors, error) {
  1703  	var resp BaseHTTPResponse
  1704  	var errors Errors
  1705  
  1706  	restClient := c.Start(&resp, &errors)
  1707  	err := restClient.WithUri("/api/api-key").
  1708  		WithUriSegment(keyId).
  1709  		WithMethod(http.MethodDelete).
  1710  		Do(ctx)
  1711  	if restClient.ErrorRef == nil {
  1712  		return &resp, nil, err
  1713  	}
  1714  	return &resp, &errors, err
  1715  }
  1716  
  1717  // DeleteApplication
  1718  // Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will
  1719  // delete the application, any registrations for that application, metrics and reports for the application, all the
  1720  // roles for the application, and any other data associated with the application. This operation could take a very
  1721  // long time, depending on the amount of data in your database.
  1722  //
  1723  //	string applicationId The Id of the application to delete.
  1724  func (c *FusionAuthClient) DeleteApplication(applicationId string) (*BaseHTTPResponse, *Errors, error) {
  1725  	return c.DeleteApplicationWithContext(context.TODO(), applicationId)
  1726  }
  1727  
  1728  // DeleteApplicationWithContext
  1729  // Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will
  1730  // delete the application, any registrations for that application, metrics and reports for the application, all the
  1731  // roles for the application, and any other data associated with the application. This operation could take a very
  1732  // long time, depending on the amount of data in your database.
  1733  //
  1734  //	string applicationId The Id of the application to delete.
  1735  func (c *FusionAuthClient) DeleteApplicationWithContext(ctx context.Context, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  1736  	var resp BaseHTTPResponse
  1737  	var errors Errors
  1738  
  1739  	restClient := c.Start(&resp, &errors)
  1740  	err := restClient.WithUri("/api/application").
  1741  		WithUriSegment(applicationId).
  1742  		WithParameter("hardDelete", strconv.FormatBool(true)).
  1743  		WithMethod(http.MethodDelete).
  1744  		Do(ctx)
  1745  	if restClient.ErrorRef == nil {
  1746  		return &resp, nil, err
  1747  	}
  1748  	return &resp, &errors, err
  1749  }
  1750  
  1751  // DeleteApplicationRole
  1752  // Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This
  1753  // permanently removes the given role from all users that had it.
  1754  //
  1755  //	string applicationId The Id of the application that the role belongs to.
  1756  //	string roleId The Id of the role to delete.
  1757  func (c *FusionAuthClient) DeleteApplicationRole(applicationId string, roleId string) (*BaseHTTPResponse, *Errors, error) {
  1758  	return c.DeleteApplicationRoleWithContext(context.TODO(), applicationId, roleId)
  1759  }
  1760  
  1761  // DeleteApplicationRoleWithContext
  1762  // Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This
  1763  // permanently removes the given role from all users that had it.
  1764  //
  1765  //	string applicationId The Id of the application that the role belongs to.
  1766  //	string roleId The Id of the role to delete.
  1767  func (c *FusionAuthClient) DeleteApplicationRoleWithContext(ctx context.Context, applicationId string, roleId string) (*BaseHTTPResponse, *Errors, error) {
  1768  	var resp BaseHTTPResponse
  1769  	var errors Errors
  1770  
  1771  	restClient := c.Start(&resp, &errors)
  1772  	err := restClient.WithUri("/api/application").
  1773  		WithUriSegment(applicationId).
  1774  		WithUriSegment("role").
  1775  		WithUriSegment(roleId).
  1776  		WithMethod(http.MethodDelete).
  1777  		Do(ctx)
  1778  	if restClient.ErrorRef == nil {
  1779  		return &resp, nil, err
  1780  	}
  1781  	return &resp, &errors, err
  1782  }
  1783  
  1784  // DeleteConnector
  1785  // Deletes the connector for the given Id.
  1786  //
  1787  //	string connectorId The Id of the connector to delete.
  1788  func (c *FusionAuthClient) DeleteConnector(connectorId string) (*BaseHTTPResponse, *Errors, error) {
  1789  	return c.DeleteConnectorWithContext(context.TODO(), connectorId)
  1790  }
  1791  
  1792  // DeleteConnectorWithContext
  1793  // Deletes the connector for the given Id.
  1794  //
  1795  //	string connectorId The Id of the connector to delete.
  1796  func (c *FusionAuthClient) DeleteConnectorWithContext(ctx context.Context, connectorId string) (*BaseHTTPResponse, *Errors, error) {
  1797  	var resp BaseHTTPResponse
  1798  	var errors Errors
  1799  
  1800  	restClient := c.Start(&resp, &errors)
  1801  	err := restClient.WithUri("/api/connector").
  1802  		WithUriSegment(connectorId).
  1803  		WithMethod(http.MethodDelete).
  1804  		Do(ctx)
  1805  	if restClient.ErrorRef == nil {
  1806  		return &resp, nil, err
  1807  	}
  1808  	return &resp, &errors, err
  1809  }
  1810  
  1811  // DeleteConsent
  1812  // Deletes the consent for the given Id.
  1813  //
  1814  //	string consentId The Id of the consent to delete.
  1815  func (c *FusionAuthClient) DeleteConsent(consentId string) (*BaseHTTPResponse, *Errors, error) {
  1816  	return c.DeleteConsentWithContext(context.TODO(), consentId)
  1817  }
  1818  
  1819  // DeleteConsentWithContext
  1820  // Deletes the consent for the given Id.
  1821  //
  1822  //	string consentId The Id of the consent to delete.
  1823  func (c *FusionAuthClient) DeleteConsentWithContext(ctx context.Context, consentId string) (*BaseHTTPResponse, *Errors, error) {
  1824  	var resp BaseHTTPResponse
  1825  	var errors Errors
  1826  
  1827  	restClient := c.Start(&resp, &errors)
  1828  	err := restClient.WithUri("/api/consent").
  1829  		WithUriSegment(consentId).
  1830  		WithMethod(http.MethodDelete).
  1831  		Do(ctx)
  1832  	if restClient.ErrorRef == nil {
  1833  		return &resp, nil, err
  1834  	}
  1835  	return &resp, &errors, err
  1836  }
  1837  
  1838  // DeleteEmailTemplate
  1839  // Deletes the email template for the given Id.
  1840  //
  1841  //	string emailTemplateId The Id of the email template to delete.
  1842  func (c *FusionAuthClient) DeleteEmailTemplate(emailTemplateId string) (*BaseHTTPResponse, *Errors, error) {
  1843  	return c.DeleteEmailTemplateWithContext(context.TODO(), emailTemplateId)
  1844  }
  1845  
  1846  // DeleteEmailTemplateWithContext
  1847  // Deletes the email template for the given Id.
  1848  //
  1849  //	string emailTemplateId The Id of the email template to delete.
  1850  func (c *FusionAuthClient) DeleteEmailTemplateWithContext(ctx context.Context, emailTemplateId string) (*BaseHTTPResponse, *Errors, error) {
  1851  	var resp BaseHTTPResponse
  1852  	var errors Errors
  1853  
  1854  	restClient := c.Start(&resp, &errors)
  1855  	err := restClient.WithUri("/api/email/template").
  1856  		WithUriSegment(emailTemplateId).
  1857  		WithMethod(http.MethodDelete).
  1858  		Do(ctx)
  1859  	if restClient.ErrorRef == nil {
  1860  		return &resp, nil, err
  1861  	}
  1862  	return &resp, &errors, err
  1863  }
  1864  
  1865  // DeleteEntity
  1866  // Deletes the Entity for the given Id.
  1867  //
  1868  //	string entityId The Id of the Entity to delete.
  1869  func (c *FusionAuthClient) DeleteEntity(entityId string) (*BaseHTTPResponse, *Errors, error) {
  1870  	return c.DeleteEntityWithContext(context.TODO(), entityId)
  1871  }
  1872  
  1873  // DeleteEntityWithContext
  1874  // Deletes the Entity for the given Id.
  1875  //
  1876  //	string entityId The Id of the Entity to delete.
  1877  func (c *FusionAuthClient) DeleteEntityWithContext(ctx context.Context, entityId string) (*BaseHTTPResponse, *Errors, error) {
  1878  	var resp BaseHTTPResponse
  1879  	var errors Errors
  1880  
  1881  	restClient := c.Start(&resp, &errors)
  1882  	err := restClient.WithUri("/api/entity").
  1883  		WithUriSegment(entityId).
  1884  		WithMethod(http.MethodDelete).
  1885  		Do(ctx)
  1886  	if restClient.ErrorRef == nil {
  1887  		return &resp, nil, err
  1888  	}
  1889  	return &resp, &errors, err
  1890  }
  1891  
  1892  // DeleteEntityGrant
  1893  // Deletes an Entity Grant for the given User or Entity.
  1894  //
  1895  //	string entityId The Id of the Entity that the Entity Grant is being deleted for.
  1896  //	string recipientEntityId (Optional) The Id of the Entity that the Entity Grant is for.
  1897  //	string userId (Optional) The Id of the User that the Entity Grant is for.
  1898  func (c *FusionAuthClient) DeleteEntityGrant(entityId string, recipientEntityId string, userId string) (*BaseHTTPResponse, *Errors, error) {
  1899  	return c.DeleteEntityGrantWithContext(context.TODO(), entityId, recipientEntityId, userId)
  1900  }
  1901  
  1902  // DeleteEntityGrantWithContext
  1903  // Deletes an Entity Grant for the given User or Entity.
  1904  //
  1905  //	string entityId The Id of the Entity that the Entity Grant is being deleted for.
  1906  //	string recipientEntityId (Optional) The Id of the Entity that the Entity Grant is for.
  1907  //	string userId (Optional) The Id of the User that the Entity Grant is for.
  1908  func (c *FusionAuthClient) DeleteEntityGrantWithContext(ctx context.Context, entityId string, recipientEntityId string, userId string) (*BaseHTTPResponse, *Errors, error) {
  1909  	var resp BaseHTTPResponse
  1910  	var errors Errors
  1911  
  1912  	restClient := c.Start(&resp, &errors)
  1913  	err := restClient.WithUri("/api/entity").
  1914  		WithUriSegment(entityId).
  1915  		WithUriSegment("grant").
  1916  		WithParameter("recipientEntityId", recipientEntityId).
  1917  		WithParameter("userId", userId).
  1918  		WithMethod(http.MethodDelete).
  1919  		Do(ctx)
  1920  	if restClient.ErrorRef == nil {
  1921  		return &resp, nil, err
  1922  	}
  1923  	return &resp, &errors, err
  1924  }
  1925  
  1926  // DeleteEntityType
  1927  // Deletes the Entity Type for the given Id.
  1928  //
  1929  //	string entityTypeId The Id of the Entity Type to delete.
  1930  func (c *FusionAuthClient) DeleteEntityType(entityTypeId string) (*BaseHTTPResponse, *Errors, error) {
  1931  	return c.DeleteEntityTypeWithContext(context.TODO(), entityTypeId)
  1932  }
  1933  
  1934  // DeleteEntityTypeWithContext
  1935  // Deletes the Entity Type for the given Id.
  1936  //
  1937  //	string entityTypeId The Id of the Entity Type to delete.
  1938  func (c *FusionAuthClient) DeleteEntityTypeWithContext(ctx context.Context, entityTypeId string) (*BaseHTTPResponse, *Errors, error) {
  1939  	var resp BaseHTTPResponse
  1940  	var errors Errors
  1941  
  1942  	restClient := c.Start(&resp, &errors)
  1943  	err := restClient.WithUri("/api/entity/type").
  1944  		WithUriSegment(entityTypeId).
  1945  		WithMethod(http.MethodDelete).
  1946  		Do(ctx)
  1947  	if restClient.ErrorRef == nil {
  1948  		return &resp, nil, err
  1949  	}
  1950  	return &resp, &errors, err
  1951  }
  1952  
  1953  // DeleteEntityTypePermission
  1954  // Hard deletes a permission. This is a dangerous operation and should not be used in most circumstances. This
  1955  // permanently removes the given permission from all grants that had it.
  1956  //
  1957  //	string entityTypeId The Id of the entityType the the permission belongs to.
  1958  //	string permissionId The Id of the permission to delete.
  1959  func (c *FusionAuthClient) DeleteEntityTypePermission(entityTypeId string, permissionId string) (*BaseHTTPResponse, *Errors, error) {
  1960  	return c.DeleteEntityTypePermissionWithContext(context.TODO(), entityTypeId, permissionId)
  1961  }
  1962  
  1963  // DeleteEntityTypePermissionWithContext
  1964  // Hard deletes a permission. This is a dangerous operation and should not be used in most circumstances. This
  1965  // permanently removes the given permission from all grants that had it.
  1966  //
  1967  //	string entityTypeId The Id of the entityType the the permission belongs to.
  1968  //	string permissionId The Id of the permission to delete.
  1969  func (c *FusionAuthClient) DeleteEntityTypePermissionWithContext(ctx context.Context, entityTypeId string, permissionId string) (*BaseHTTPResponse, *Errors, error) {
  1970  	var resp BaseHTTPResponse
  1971  	var errors Errors
  1972  
  1973  	restClient := c.Start(&resp, &errors)
  1974  	err := restClient.WithUri("/api/entity/type").
  1975  		WithUriSegment(entityTypeId).
  1976  		WithUriSegment("permission").
  1977  		WithUriSegment(permissionId).
  1978  		WithMethod(http.MethodDelete).
  1979  		Do(ctx)
  1980  	if restClient.ErrorRef == nil {
  1981  		return &resp, nil, err
  1982  	}
  1983  	return &resp, &errors, err
  1984  }
  1985  
  1986  // DeleteForm
  1987  // Deletes the form for the given Id.
  1988  //
  1989  //	string formId The Id of the form to delete.
  1990  func (c *FusionAuthClient) DeleteForm(formId string) (*BaseHTTPResponse, *Errors, error) {
  1991  	return c.DeleteFormWithContext(context.TODO(), formId)
  1992  }
  1993  
  1994  // DeleteFormWithContext
  1995  // Deletes the form for the given Id.
  1996  //
  1997  //	string formId The Id of the form to delete.
  1998  func (c *FusionAuthClient) DeleteFormWithContext(ctx context.Context, formId string) (*BaseHTTPResponse, *Errors, error) {
  1999  	var resp BaseHTTPResponse
  2000  	var errors Errors
  2001  
  2002  	restClient := c.Start(&resp, &errors)
  2003  	err := restClient.WithUri("/api/form").
  2004  		WithUriSegment(formId).
  2005  		WithMethod(http.MethodDelete).
  2006  		Do(ctx)
  2007  	if restClient.ErrorRef == nil {
  2008  		return &resp, nil, err
  2009  	}
  2010  	return &resp, &errors, err
  2011  }
  2012  
  2013  // DeleteFormField
  2014  // Deletes the form field for the given Id.
  2015  //
  2016  //	string fieldId The Id of the form field to delete.
  2017  func (c *FusionAuthClient) DeleteFormField(fieldId string) (*BaseHTTPResponse, *Errors, error) {
  2018  	return c.DeleteFormFieldWithContext(context.TODO(), fieldId)
  2019  }
  2020  
  2021  // DeleteFormFieldWithContext
  2022  // Deletes the form field for the given Id.
  2023  //
  2024  //	string fieldId The Id of the form field to delete.
  2025  func (c *FusionAuthClient) DeleteFormFieldWithContext(ctx context.Context, fieldId string) (*BaseHTTPResponse, *Errors, error) {
  2026  	var resp BaseHTTPResponse
  2027  	var errors Errors
  2028  
  2029  	restClient := c.Start(&resp, &errors)
  2030  	err := restClient.WithUri("/api/form/field").
  2031  		WithUriSegment(fieldId).
  2032  		WithMethod(http.MethodDelete).
  2033  		Do(ctx)
  2034  	if restClient.ErrorRef == nil {
  2035  		return &resp, nil, err
  2036  	}
  2037  	return &resp, &errors, err
  2038  }
  2039  
  2040  // DeleteGroup
  2041  // Deletes the group for the given Id.
  2042  //
  2043  //	string groupId The Id of the group to delete.
  2044  func (c *FusionAuthClient) DeleteGroup(groupId string) (*BaseHTTPResponse, *Errors, error) {
  2045  	return c.DeleteGroupWithContext(context.TODO(), groupId)
  2046  }
  2047  
  2048  // DeleteGroupWithContext
  2049  // Deletes the group for the given Id.
  2050  //
  2051  //	string groupId The Id of the group to delete.
  2052  func (c *FusionAuthClient) DeleteGroupWithContext(ctx context.Context, groupId string) (*BaseHTTPResponse, *Errors, error) {
  2053  	var resp BaseHTTPResponse
  2054  	var errors Errors
  2055  
  2056  	restClient := c.Start(&resp, &errors)
  2057  	err := restClient.WithUri("/api/group").
  2058  		WithUriSegment(groupId).
  2059  		WithMethod(http.MethodDelete).
  2060  		Do(ctx)
  2061  	if restClient.ErrorRef == nil {
  2062  		return &resp, nil, err
  2063  	}
  2064  	return &resp, &errors, err
  2065  }
  2066  
  2067  // DeleteGroupMembers
  2068  // Removes users as members of a group.
  2069  //
  2070  //	MemberDeleteRequest request The member request that contains all the information used to remove members to the group.
  2071  func (c *FusionAuthClient) DeleteGroupMembers(request MemberDeleteRequest) (*BaseHTTPResponse, *Errors, error) {
  2072  	return c.DeleteGroupMembersWithContext(context.TODO(), request)
  2073  }
  2074  
  2075  // DeleteGroupMembersWithContext
  2076  // Removes users as members of a group.
  2077  //
  2078  //	MemberDeleteRequest request The member request that contains all the information used to remove members to the group.
  2079  func (c *FusionAuthClient) DeleteGroupMembersWithContext(ctx context.Context, request MemberDeleteRequest) (*BaseHTTPResponse, *Errors, error) {
  2080  	var resp BaseHTTPResponse
  2081  	var errors Errors
  2082  
  2083  	restClient := c.Start(&resp, &errors)
  2084  	err := restClient.WithUri("/api/group/member").
  2085  		WithJSONBody(request).
  2086  		WithMethod(http.MethodDelete).
  2087  		Do(ctx)
  2088  	if restClient.ErrorRef == nil {
  2089  		return &resp, nil, err
  2090  	}
  2091  	return &resp, &errors, err
  2092  }
  2093  
  2094  // DeleteIPAccessControlList
  2095  // Deletes the IP Access Control List for the given Id.
  2096  //
  2097  //	string ipAccessControlListId The Id of the IP Access Control List to delete.
  2098  func (c *FusionAuthClient) DeleteIPAccessControlList(ipAccessControlListId string) (*BaseHTTPResponse, *Errors, error) {
  2099  	return c.DeleteIPAccessControlListWithContext(context.TODO(), ipAccessControlListId)
  2100  }
  2101  
  2102  // DeleteIPAccessControlListWithContext
  2103  // Deletes the IP Access Control List for the given Id.
  2104  //
  2105  //	string ipAccessControlListId The Id of the IP Access Control List to delete.
  2106  func (c *FusionAuthClient) DeleteIPAccessControlListWithContext(ctx context.Context, ipAccessControlListId string) (*BaseHTTPResponse, *Errors, error) {
  2107  	var resp BaseHTTPResponse
  2108  	var errors Errors
  2109  
  2110  	restClient := c.Start(&resp, &errors)
  2111  	err := restClient.WithUri("/api/ip-acl").
  2112  		WithUriSegment(ipAccessControlListId).
  2113  		WithMethod(http.MethodDelete).
  2114  		Do(ctx)
  2115  	if restClient.ErrorRef == nil {
  2116  		return &resp, nil, err
  2117  	}
  2118  	return &resp, &errors, err
  2119  }
  2120  
  2121  // DeleteIdentityProvider
  2122  // Deletes the identity provider for the given Id.
  2123  //
  2124  //	string identityProviderId The Id of the identity provider to delete.
  2125  func (c *FusionAuthClient) DeleteIdentityProvider(identityProviderId string) (*BaseHTTPResponse, *Errors, error) {
  2126  	return c.DeleteIdentityProviderWithContext(context.TODO(), identityProviderId)
  2127  }
  2128  
  2129  // DeleteIdentityProviderWithContext
  2130  // Deletes the identity provider for the given Id.
  2131  //
  2132  //	string identityProviderId The Id of the identity provider to delete.
  2133  func (c *FusionAuthClient) DeleteIdentityProviderWithContext(ctx context.Context, identityProviderId string) (*BaseHTTPResponse, *Errors, error) {
  2134  	var resp BaseHTTPResponse
  2135  	var errors Errors
  2136  
  2137  	restClient := c.Start(&resp, &errors)
  2138  	err := restClient.WithUri("/api/identity-provider").
  2139  		WithUriSegment(identityProviderId).
  2140  		WithMethod(http.MethodDelete).
  2141  		Do(ctx)
  2142  	if restClient.ErrorRef == nil {
  2143  		return &resp, nil, err
  2144  	}
  2145  	return &resp, &errors, err
  2146  }
  2147  
  2148  // DeleteKey
  2149  // Deletes the key for the given Id.
  2150  //
  2151  //	string keyId The Id of the key to delete.
  2152  func (c *FusionAuthClient) DeleteKey(keyId string) (*BaseHTTPResponse, *Errors, error) {
  2153  	return c.DeleteKeyWithContext(context.TODO(), keyId)
  2154  }
  2155  
  2156  // DeleteKeyWithContext
  2157  // Deletes the key for the given Id.
  2158  //
  2159  //	string keyId The Id of the key to delete.
  2160  func (c *FusionAuthClient) DeleteKeyWithContext(ctx context.Context, keyId string) (*BaseHTTPResponse, *Errors, error) {
  2161  	var resp BaseHTTPResponse
  2162  	var errors Errors
  2163  
  2164  	restClient := c.Start(&resp, &errors)
  2165  	err := restClient.WithUri("/api/key").
  2166  		WithUriSegment(keyId).
  2167  		WithMethod(http.MethodDelete).
  2168  		Do(ctx)
  2169  	if restClient.ErrorRef == nil {
  2170  		return &resp, nil, err
  2171  	}
  2172  	return &resp, &errors, err
  2173  }
  2174  
  2175  // DeleteLambda
  2176  // Deletes the lambda for the given Id.
  2177  //
  2178  //	string lambdaId The Id of the lambda to delete.
  2179  func (c *FusionAuthClient) DeleteLambda(lambdaId string) (*BaseHTTPResponse, *Errors, error) {
  2180  	return c.DeleteLambdaWithContext(context.TODO(), lambdaId)
  2181  }
  2182  
  2183  // DeleteLambdaWithContext
  2184  // Deletes the lambda for the given Id.
  2185  //
  2186  //	string lambdaId The Id of the lambda to delete.
  2187  func (c *FusionAuthClient) DeleteLambdaWithContext(ctx context.Context, lambdaId string) (*BaseHTTPResponse, *Errors, error) {
  2188  	var resp BaseHTTPResponse
  2189  	var errors Errors
  2190  
  2191  	restClient := c.Start(&resp, &errors)
  2192  	err := restClient.WithUri("/api/lambda").
  2193  		WithUriSegment(lambdaId).
  2194  		WithMethod(http.MethodDelete).
  2195  		Do(ctx)
  2196  	if restClient.ErrorRef == nil {
  2197  		return &resp, nil, err
  2198  	}
  2199  	return &resp, &errors, err
  2200  }
  2201  
  2202  // DeleteMessageTemplate
  2203  // Deletes the message template for the given Id.
  2204  //
  2205  //	string messageTemplateId The Id of the message template to delete.
  2206  func (c *FusionAuthClient) DeleteMessageTemplate(messageTemplateId string) (*BaseHTTPResponse, *Errors, error) {
  2207  	return c.DeleteMessageTemplateWithContext(context.TODO(), messageTemplateId)
  2208  }
  2209  
  2210  // DeleteMessageTemplateWithContext
  2211  // Deletes the message template for the given Id.
  2212  //
  2213  //	string messageTemplateId The Id of the message template to delete.
  2214  func (c *FusionAuthClient) DeleteMessageTemplateWithContext(ctx context.Context, messageTemplateId string) (*BaseHTTPResponse, *Errors, error) {
  2215  	var resp BaseHTTPResponse
  2216  	var errors Errors
  2217  
  2218  	restClient := c.Start(&resp, &errors)
  2219  	err := restClient.WithUri("/api/message/template").
  2220  		WithUriSegment(messageTemplateId).
  2221  		WithMethod(http.MethodDelete).
  2222  		Do(ctx)
  2223  	if restClient.ErrorRef == nil {
  2224  		return &resp, nil, err
  2225  	}
  2226  	return &resp, &errors, err
  2227  }
  2228  
  2229  // DeleteMessenger
  2230  // Deletes the messenger for the given Id.
  2231  //
  2232  //	string messengerId The Id of the messenger to delete.
  2233  func (c *FusionAuthClient) DeleteMessenger(messengerId string) (*BaseHTTPResponse, *Errors, error) {
  2234  	return c.DeleteMessengerWithContext(context.TODO(), messengerId)
  2235  }
  2236  
  2237  // DeleteMessengerWithContext
  2238  // Deletes the messenger for the given Id.
  2239  //
  2240  //	string messengerId The Id of the messenger to delete.
  2241  func (c *FusionAuthClient) DeleteMessengerWithContext(ctx context.Context, messengerId string) (*BaseHTTPResponse, *Errors, error) {
  2242  	var resp BaseHTTPResponse
  2243  	var errors Errors
  2244  
  2245  	restClient := c.Start(&resp, &errors)
  2246  	err := restClient.WithUri("/api/messenger").
  2247  		WithUriSegment(messengerId).
  2248  		WithMethod(http.MethodDelete).
  2249  		Do(ctx)
  2250  	if restClient.ErrorRef == nil {
  2251  		return &resp, nil, err
  2252  	}
  2253  	return &resp, &errors, err
  2254  }
  2255  
  2256  // DeleteOAuthScope
  2257  // Hard deletes a custom OAuth scope.
  2258  // OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
  2259  //
  2260  //	string applicationId The Id of the application that the OAuth scope belongs to.
  2261  //	string scopeId The Id of the OAuth scope to delete.
  2262  func (c *FusionAuthClient) DeleteOAuthScope(applicationId string, scopeId string) (*BaseHTTPResponse, *Errors, error) {
  2263  	return c.DeleteOAuthScopeWithContext(context.TODO(), applicationId, scopeId)
  2264  }
  2265  
  2266  // DeleteOAuthScopeWithContext
  2267  // Hard deletes a custom OAuth scope.
  2268  // OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
  2269  //
  2270  //	string applicationId The Id of the application that the OAuth scope belongs to.
  2271  //	string scopeId The Id of the OAuth scope to delete.
  2272  func (c *FusionAuthClient) DeleteOAuthScopeWithContext(ctx context.Context, applicationId string, scopeId string) (*BaseHTTPResponse, *Errors, error) {
  2273  	var resp BaseHTTPResponse
  2274  	var errors Errors
  2275  
  2276  	restClient := c.Start(&resp, &errors)
  2277  	err := restClient.WithUri("/api/application").
  2278  		WithUriSegment(applicationId).
  2279  		WithUriSegment("scope").
  2280  		WithUriSegment(scopeId).
  2281  		WithMethod(http.MethodDelete).
  2282  		Do(ctx)
  2283  	if restClient.ErrorRef == nil {
  2284  		return &resp, nil, err
  2285  	}
  2286  	return &resp, &errors, err
  2287  }
  2288  
  2289  // DeleteRegistration
  2290  // Deletes the user registration for the given user and application.
  2291  //
  2292  //	string userId The Id of the user whose registration is being deleted.
  2293  //	string applicationId The Id of the application to remove the registration for.
  2294  func (c *FusionAuthClient) DeleteRegistration(userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  2295  	return c.DeleteRegistrationWithContext(context.TODO(), userId, applicationId)
  2296  }
  2297  
  2298  // DeleteRegistrationWithContext
  2299  // Deletes the user registration for the given user and application.
  2300  //
  2301  //	string userId The Id of the user whose registration is being deleted.
  2302  //	string applicationId The Id of the application to remove the registration for.
  2303  func (c *FusionAuthClient) DeleteRegistrationWithContext(ctx context.Context, userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  2304  	var resp BaseHTTPResponse
  2305  	var errors Errors
  2306  
  2307  	restClient := c.Start(&resp, &errors)
  2308  	err := restClient.WithUri("/api/user/registration").
  2309  		WithUriSegment(userId).
  2310  		WithUriSegment(applicationId).
  2311  		WithMethod(http.MethodDelete).
  2312  		Do(ctx)
  2313  	if restClient.ErrorRef == nil {
  2314  		return &resp, nil, err
  2315  	}
  2316  	return &resp, &errors, err
  2317  }
  2318  
  2319  // DeleteRegistrationWithRequest
  2320  // Deletes the user registration for the given user and application along with the given JSON body that contains the event information.
  2321  //
  2322  //	string userId The Id of the user whose registration is being deleted.
  2323  //	string applicationId The Id of the application to remove the registration for.
  2324  //	RegistrationDeleteRequest request The request body that contains the event information.
  2325  func (c *FusionAuthClient) DeleteRegistrationWithRequest(userId string, applicationId string, request RegistrationDeleteRequest) (*BaseHTTPResponse, *Errors, error) {
  2326  	return c.DeleteRegistrationWithRequestWithContext(context.TODO(), userId, applicationId, request)
  2327  }
  2328  
  2329  // DeleteRegistrationWithRequestWithContext
  2330  // Deletes the user registration for the given user and application along with the given JSON body that contains the event information.
  2331  //
  2332  //	string userId The Id of the user whose registration is being deleted.
  2333  //	string applicationId The Id of the application to remove the registration for.
  2334  //	RegistrationDeleteRequest request The request body that contains the event information.
  2335  func (c *FusionAuthClient) DeleteRegistrationWithRequestWithContext(ctx context.Context, userId string, applicationId string, request RegistrationDeleteRequest) (*BaseHTTPResponse, *Errors, error) {
  2336  	var resp BaseHTTPResponse
  2337  	var errors Errors
  2338  
  2339  	restClient := c.Start(&resp, &errors)
  2340  	err := restClient.WithUri("/api/user/registration").
  2341  		WithUriSegment(userId).
  2342  		WithUriSegment(applicationId).
  2343  		WithJSONBody(request).
  2344  		WithMethod(http.MethodDelete).
  2345  		Do(ctx)
  2346  	if restClient.ErrorRef == nil {
  2347  		return &resp, nil, err
  2348  	}
  2349  	return &resp, &errors, err
  2350  }
  2351  
  2352  // DeleteTenant
  2353  // Deletes the tenant based on the given Id on the URL. This permanently deletes all information, metrics, reports and data associated
  2354  // with the tenant and everything under the tenant (applications, users, etc).
  2355  //
  2356  //	string tenantId The Id of the tenant to delete.
  2357  func (c *FusionAuthClient) DeleteTenant(tenantId string) (*BaseHTTPResponse, *Errors, error) {
  2358  	return c.DeleteTenantWithContext(context.TODO(), tenantId)
  2359  }
  2360  
  2361  // DeleteTenantWithContext
  2362  // Deletes the tenant based on the given Id on the URL. This permanently deletes all information, metrics, reports and data associated
  2363  // with the tenant and everything under the tenant (applications, users, etc).
  2364  //
  2365  //	string tenantId The Id of the tenant to delete.
  2366  func (c *FusionAuthClient) DeleteTenantWithContext(ctx context.Context, tenantId string) (*BaseHTTPResponse, *Errors, error) {
  2367  	var resp BaseHTTPResponse
  2368  	var errors Errors
  2369  
  2370  	restClient := c.Start(&resp, &errors)
  2371  	err := restClient.WithUri("/api/tenant").
  2372  		WithUriSegment(tenantId).
  2373  		WithMethod(http.MethodDelete).
  2374  		Do(ctx)
  2375  	if restClient.ErrorRef == nil {
  2376  		return &resp, nil, err
  2377  	}
  2378  	return &resp, &errors, err
  2379  }
  2380  
  2381  // DeleteTenantAsync
  2382  // Deletes the tenant for the given Id asynchronously.
  2383  // This method is helpful if you do not want to wait for the delete operation to complete.
  2384  //
  2385  //	string tenantId The Id of the tenant to delete.
  2386  func (c *FusionAuthClient) DeleteTenantAsync(tenantId string) (*BaseHTTPResponse, *Errors, error) {
  2387  	return c.DeleteTenantAsyncWithContext(context.TODO(), tenantId)
  2388  }
  2389  
  2390  // DeleteTenantAsyncWithContext
  2391  // Deletes the tenant for the given Id asynchronously.
  2392  // This method is helpful if you do not want to wait for the delete operation to complete.
  2393  //
  2394  //	string tenantId The Id of the tenant to delete.
  2395  func (c *FusionAuthClient) DeleteTenantAsyncWithContext(ctx context.Context, tenantId string) (*BaseHTTPResponse, *Errors, error) {
  2396  	var resp BaseHTTPResponse
  2397  	var errors Errors
  2398  
  2399  	restClient := c.Start(&resp, &errors)
  2400  	err := restClient.WithUri("/api/tenant").
  2401  		WithUriSegment(tenantId).
  2402  		WithParameter("async", strconv.FormatBool(true)).
  2403  		WithMethod(http.MethodDelete).
  2404  		Do(ctx)
  2405  	if restClient.ErrorRef == nil {
  2406  		return &resp, nil, err
  2407  	}
  2408  	return &resp, &errors, err
  2409  }
  2410  
  2411  // DeleteTenantWithRequest
  2412  // Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
  2413  // with the tenant and everything under the tenant (applications, users, etc).
  2414  //
  2415  //	string tenantId The Id of the tenant to delete.
  2416  //	TenantDeleteRequest request The request object that contains all the information used to delete the user.
  2417  func (c *FusionAuthClient) DeleteTenantWithRequest(tenantId string, request TenantDeleteRequest) (*BaseHTTPResponse, *Errors, error) {
  2418  	return c.DeleteTenantWithRequestWithContext(context.TODO(), tenantId, request)
  2419  }
  2420  
  2421  // DeleteTenantWithRequestWithContext
  2422  // Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
  2423  // with the tenant and everything under the tenant (applications, users, etc).
  2424  //
  2425  //	string tenantId The Id of the tenant to delete.
  2426  //	TenantDeleteRequest request The request object that contains all the information used to delete the user.
  2427  func (c *FusionAuthClient) DeleteTenantWithRequestWithContext(ctx context.Context, tenantId string, request TenantDeleteRequest) (*BaseHTTPResponse, *Errors, error) {
  2428  	var resp BaseHTTPResponse
  2429  	var errors Errors
  2430  
  2431  	restClient := c.Start(&resp, &errors)
  2432  	err := restClient.WithUri("/api/tenant").
  2433  		WithUriSegment(tenantId).
  2434  		WithJSONBody(request).
  2435  		WithMethod(http.MethodDelete).
  2436  		Do(ctx)
  2437  	if restClient.ErrorRef == nil {
  2438  		return &resp, nil, err
  2439  	}
  2440  	return &resp, &errors, err
  2441  }
  2442  
  2443  // DeleteTheme
  2444  // Deletes the theme for the given Id.
  2445  //
  2446  //	string themeId The Id of the theme to delete.
  2447  func (c *FusionAuthClient) DeleteTheme(themeId string) (*BaseHTTPResponse, *Errors, error) {
  2448  	return c.DeleteThemeWithContext(context.TODO(), themeId)
  2449  }
  2450  
  2451  // DeleteThemeWithContext
  2452  // Deletes the theme for the given Id.
  2453  //
  2454  //	string themeId The Id of the theme to delete.
  2455  func (c *FusionAuthClient) DeleteThemeWithContext(ctx context.Context, themeId string) (*BaseHTTPResponse, *Errors, error) {
  2456  	var resp BaseHTTPResponse
  2457  	var errors Errors
  2458  
  2459  	restClient := c.Start(&resp, &errors)
  2460  	err := restClient.WithUri("/api/theme").
  2461  		WithUriSegment(themeId).
  2462  		WithMethod(http.MethodDelete).
  2463  		Do(ctx)
  2464  	if restClient.ErrorRef == nil {
  2465  		return &resp, nil, err
  2466  	}
  2467  	return &resp, &errors, err
  2468  }
  2469  
  2470  // DeleteUser
  2471  // Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
  2472  // with the user.
  2473  //
  2474  //	string userId The Id of the user to delete.
  2475  func (c *FusionAuthClient) DeleteUser(userId string) (*BaseHTTPResponse, *Errors, error) {
  2476  	return c.DeleteUserWithContext(context.TODO(), userId)
  2477  }
  2478  
  2479  // DeleteUserWithContext
  2480  // Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
  2481  // with the user.
  2482  //
  2483  //	string userId The Id of the user to delete.
  2484  func (c *FusionAuthClient) DeleteUserWithContext(ctx context.Context, userId string) (*BaseHTTPResponse, *Errors, error) {
  2485  	var resp BaseHTTPResponse
  2486  	var errors Errors
  2487  
  2488  	restClient := c.Start(&resp, &errors)
  2489  	err := restClient.WithUri("/api/user").
  2490  		WithUriSegment(userId).
  2491  		WithParameter("hardDelete", strconv.FormatBool(true)).
  2492  		WithMethod(http.MethodDelete).
  2493  		Do(ctx)
  2494  	if restClient.ErrorRef == nil {
  2495  		return &resp, nil, err
  2496  	}
  2497  	return &resp, &errors, err
  2498  }
  2499  
  2500  // DeleteUserAction
  2501  // Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of
  2502  // the action being applied to any users.
  2503  //
  2504  //	string userActionId The Id of the user action to delete.
  2505  func (c *FusionAuthClient) DeleteUserAction(userActionId string) (*BaseHTTPResponse, *Errors, error) {
  2506  	return c.DeleteUserActionWithContext(context.TODO(), userActionId)
  2507  }
  2508  
  2509  // DeleteUserActionWithContext
  2510  // Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of
  2511  // the action being applied to any users.
  2512  //
  2513  //	string userActionId The Id of the user action to delete.
  2514  func (c *FusionAuthClient) DeleteUserActionWithContext(ctx context.Context, userActionId string) (*BaseHTTPResponse, *Errors, error) {
  2515  	var resp BaseHTTPResponse
  2516  	var errors Errors
  2517  
  2518  	restClient := c.Start(&resp, &errors)
  2519  	err := restClient.WithUri("/api/user-action").
  2520  		WithUriSegment(userActionId).
  2521  		WithParameter("hardDelete", strconv.FormatBool(true)).
  2522  		WithMethod(http.MethodDelete).
  2523  		Do(ctx)
  2524  	if restClient.ErrorRef == nil {
  2525  		return &resp, nil, err
  2526  	}
  2527  	return &resp, &errors, err
  2528  }
  2529  
  2530  // DeleteUserActionReason
  2531  // Deletes the user action reason for the given Id.
  2532  //
  2533  //	string userActionReasonId The Id of the user action reason to delete.
  2534  func (c *FusionAuthClient) DeleteUserActionReason(userActionReasonId string) (*BaseHTTPResponse, *Errors, error) {
  2535  	return c.DeleteUserActionReasonWithContext(context.TODO(), userActionReasonId)
  2536  }
  2537  
  2538  // DeleteUserActionReasonWithContext
  2539  // Deletes the user action reason for the given Id.
  2540  //
  2541  //	string userActionReasonId The Id of the user action reason to delete.
  2542  func (c *FusionAuthClient) DeleteUserActionReasonWithContext(ctx context.Context, userActionReasonId string) (*BaseHTTPResponse, *Errors, error) {
  2543  	var resp BaseHTTPResponse
  2544  	var errors Errors
  2545  
  2546  	restClient := c.Start(&resp, &errors)
  2547  	err := restClient.WithUri("/api/user-action-reason").
  2548  		WithUriSegment(userActionReasonId).
  2549  		WithMethod(http.MethodDelete).
  2550  		Do(ctx)
  2551  	if restClient.ErrorRef == nil {
  2552  		return &resp, nil, err
  2553  	}
  2554  	return &resp, &errors, err
  2555  }
  2556  
  2557  // DeleteUserLink
  2558  // Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
  2559  //
  2560  //	string identityProviderId The unique Id of the identity provider.
  2561  //	string identityProviderUserId The unique Id of the user in the 3rd party identity provider to unlink.
  2562  //	string userId The unique Id of the FusionAuth user to unlink.
  2563  func (c *FusionAuthClient) DeleteUserLink(identityProviderId string, identityProviderUserId string, userId string) (*IdentityProviderLinkResponse, *Errors, error) {
  2564  	return c.DeleteUserLinkWithContext(context.TODO(), identityProviderId, identityProviderUserId, userId)
  2565  }
  2566  
  2567  // DeleteUserLinkWithContext
  2568  // Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
  2569  //
  2570  //	string identityProviderId The unique Id of the identity provider.
  2571  //	string identityProviderUserId The unique Id of the user in the 3rd party identity provider to unlink.
  2572  //	string userId The unique Id of the FusionAuth user to unlink.
  2573  func (c *FusionAuthClient) DeleteUserLinkWithContext(ctx context.Context, identityProviderId string, identityProviderUserId string, userId string) (*IdentityProviderLinkResponse, *Errors, error) {
  2574  	var resp IdentityProviderLinkResponse
  2575  	var errors Errors
  2576  
  2577  	restClient := c.Start(&resp, &errors)
  2578  	err := restClient.WithUri("/api/identity-provider/link").
  2579  		WithParameter("identityProviderId", identityProviderId).
  2580  		WithParameter("identityProviderUserId", identityProviderUserId).
  2581  		WithParameter("userId", userId).
  2582  		WithMethod(http.MethodDelete).
  2583  		Do(ctx)
  2584  	if restClient.ErrorRef == nil {
  2585  		return &resp, nil, err
  2586  	}
  2587  	return &resp, &errors, err
  2588  }
  2589  
  2590  // DeleteUserWithRequest
  2591  // Deletes the user based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
  2592  // with the user.
  2593  //
  2594  //	string userId The Id of the user to delete (required).
  2595  //	UserDeleteSingleRequest request The request object that contains all the information used to delete the user.
  2596  func (c *FusionAuthClient) DeleteUserWithRequest(userId string, request UserDeleteSingleRequest) (*BaseHTTPResponse, *Errors, error) {
  2597  	return c.DeleteUserWithRequestWithContext(context.TODO(), userId, request)
  2598  }
  2599  
  2600  // DeleteUserWithRequestWithContext
  2601  // Deletes the user based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
  2602  // with the user.
  2603  //
  2604  //	string userId The Id of the user to delete (required).
  2605  //	UserDeleteSingleRequest request The request object that contains all the information used to delete the user.
  2606  func (c *FusionAuthClient) DeleteUserWithRequestWithContext(ctx context.Context, userId string, request UserDeleteSingleRequest) (*BaseHTTPResponse, *Errors, error) {
  2607  	var resp BaseHTTPResponse
  2608  	var errors Errors
  2609  
  2610  	restClient := c.Start(&resp, &errors)
  2611  	err := restClient.WithUri("/api/user").
  2612  		WithUriSegment(userId).
  2613  		WithJSONBody(request).
  2614  		WithMethod(http.MethodDelete).
  2615  		Do(ctx)
  2616  	if restClient.ErrorRef == nil {
  2617  		return &resp, nil, err
  2618  	}
  2619  	return &resp, &errors, err
  2620  }
  2621  
  2622  // DeleteUsers
  2623  // Deletes the users with the given ids, or users matching the provided JSON query or queryString.
  2624  // The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
  2625  //
  2626  // This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
  2627  // Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
  2628  //
  2629  //	UserDeleteRequest request The UserDeleteRequest.
  2630  //
  2631  // Deprecated: This method has been renamed to DeleteUsersByQuery, use that method instead.
  2632  func (c *FusionAuthClient) DeleteUsers(request UserDeleteRequest) (*UserDeleteResponse, *Errors, error) {
  2633  	return c.DeleteUsersWithContext(context.TODO(), request)
  2634  }
  2635  
  2636  // DeleteUsersWithContext
  2637  // Deletes the users with the given ids, or users matching the provided JSON query or queryString.
  2638  // The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
  2639  //
  2640  // This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
  2641  // Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
  2642  //
  2643  //	UserDeleteRequest request The UserDeleteRequest.
  2644  //
  2645  // Deprecated: This method has been renamed to DeleteUsersByQueryWithContext, use that method instead.
  2646  func (c *FusionAuthClient) DeleteUsersWithContext(ctx context.Context, request UserDeleteRequest) (*UserDeleteResponse, *Errors, error) {
  2647  	var resp UserDeleteResponse
  2648  	var errors Errors
  2649  
  2650  	restClient := c.Start(&resp, &errors)
  2651  	err := restClient.WithUri("/api/user/bulk").
  2652  		WithJSONBody(request).
  2653  		WithMethod(http.MethodDelete).
  2654  		Do(ctx)
  2655  	if restClient.ErrorRef == nil {
  2656  		return &resp, nil, err
  2657  	}
  2658  	return &resp, &errors, err
  2659  }
  2660  
  2661  // DeleteUsersByQuery
  2662  // Deletes the users with the given ids, or users matching the provided JSON query or queryString.
  2663  // The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
  2664  //
  2665  // This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
  2666  // Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
  2667  //
  2668  //	UserDeleteRequest request The UserDeleteRequest.
  2669  func (c *FusionAuthClient) DeleteUsersByQuery(request UserDeleteRequest) (*UserDeleteResponse, *Errors, error) {
  2670  	return c.DeleteUsersByQueryWithContext(context.TODO(), request)
  2671  }
  2672  
  2673  // DeleteUsersByQueryWithContext
  2674  // Deletes the users with the given ids, or users matching the provided JSON query or queryString.
  2675  // The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
  2676  //
  2677  // This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
  2678  // Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
  2679  //
  2680  //	UserDeleteRequest request The UserDeleteRequest.
  2681  func (c *FusionAuthClient) DeleteUsersByQueryWithContext(ctx context.Context, request UserDeleteRequest) (*UserDeleteResponse, *Errors, error) {
  2682  	var resp UserDeleteResponse
  2683  	var errors Errors
  2684  
  2685  	restClient := c.Start(&resp, &errors)
  2686  	err := restClient.WithUri("/api/user/bulk").
  2687  		WithJSONBody(request).
  2688  		WithMethod(http.MethodDelete).
  2689  		Do(ctx)
  2690  	if restClient.ErrorRef == nil {
  2691  		return &resp, nil, err
  2692  	}
  2693  	return &resp, &errors, err
  2694  }
  2695  
  2696  // DeleteWebAuthnCredential
  2697  // Deletes the WebAuthn credential for the given Id.
  2698  //
  2699  //	string id The Id of the WebAuthn credential to delete.
  2700  func (c *FusionAuthClient) DeleteWebAuthnCredential(id string) (*BaseHTTPResponse, *Errors, error) {
  2701  	return c.DeleteWebAuthnCredentialWithContext(context.TODO(), id)
  2702  }
  2703  
  2704  // DeleteWebAuthnCredentialWithContext
  2705  // Deletes the WebAuthn credential for the given Id.
  2706  //
  2707  //	string id The Id of the WebAuthn credential to delete.
  2708  func (c *FusionAuthClient) DeleteWebAuthnCredentialWithContext(ctx context.Context, id string) (*BaseHTTPResponse, *Errors, error) {
  2709  	var resp BaseHTTPResponse
  2710  	var errors Errors
  2711  
  2712  	restClient := c.Start(&resp, &errors)
  2713  	err := restClient.WithUri("/api/webauthn").
  2714  		WithUriSegment(id).
  2715  		WithMethod(http.MethodDelete).
  2716  		Do(ctx)
  2717  	if restClient.ErrorRef == nil {
  2718  		return &resp, nil, err
  2719  	}
  2720  	return &resp, &errors, err
  2721  }
  2722  
  2723  // DeleteWebhook
  2724  // Deletes the webhook for the given Id.
  2725  //
  2726  //	string webhookId The Id of the webhook to delete.
  2727  func (c *FusionAuthClient) DeleteWebhook(webhookId string) (*BaseHTTPResponse, *Errors, error) {
  2728  	return c.DeleteWebhookWithContext(context.TODO(), webhookId)
  2729  }
  2730  
  2731  // DeleteWebhookWithContext
  2732  // Deletes the webhook for the given Id.
  2733  //
  2734  //	string webhookId The Id of the webhook to delete.
  2735  func (c *FusionAuthClient) DeleteWebhookWithContext(ctx context.Context, webhookId string) (*BaseHTTPResponse, *Errors, error) {
  2736  	var resp BaseHTTPResponse
  2737  	var errors Errors
  2738  
  2739  	restClient := c.Start(&resp, &errors)
  2740  	err := restClient.WithUri("/api/webhook").
  2741  		WithUriSegment(webhookId).
  2742  		WithMethod(http.MethodDelete).
  2743  		Do(ctx)
  2744  	if restClient.ErrorRef == nil {
  2745  		return &resp, nil, err
  2746  	}
  2747  	return &resp, &errors, err
  2748  }
  2749  
  2750  // DisableTwoFactor
  2751  // Disable two-factor authentication for a user.
  2752  //
  2753  //	string userId The Id of the User for which you're disabling two-factor authentication.
  2754  //	string methodId The two-factor method identifier you wish to disable
  2755  //	string code The two-factor code used verify the the caller knows the two-factor secret.
  2756  func (c *FusionAuthClient) DisableTwoFactor(userId string, methodId string, code string) (*BaseHTTPResponse, *Errors, error) {
  2757  	return c.DisableTwoFactorWithContext(context.TODO(), userId, methodId, code)
  2758  }
  2759  
  2760  // DisableTwoFactorWithContext
  2761  // Disable two-factor authentication for a user.
  2762  //
  2763  //	string userId The Id of the User for which you're disabling two-factor authentication.
  2764  //	string methodId The two-factor method identifier you wish to disable
  2765  //	string code The two-factor code used verify the the caller knows the two-factor secret.
  2766  func (c *FusionAuthClient) DisableTwoFactorWithContext(ctx context.Context, userId string, methodId string, code string) (*BaseHTTPResponse, *Errors, error) {
  2767  	var resp BaseHTTPResponse
  2768  	var errors Errors
  2769  
  2770  	restClient := c.Start(&resp, &errors)
  2771  	err := restClient.WithUri("/api/user/two-factor").
  2772  		WithUriSegment(userId).
  2773  		WithParameter("methodId", methodId).
  2774  		WithParameter("code", code).
  2775  		WithMethod(http.MethodDelete).
  2776  		Do(ctx)
  2777  	if restClient.ErrorRef == nil {
  2778  		return &resp, nil, err
  2779  	}
  2780  	return &resp, &errors, err
  2781  }
  2782  
  2783  // DisableTwoFactorWithRequest
  2784  // Disable two-factor authentication for a user using a JSON body rather than URL parameters.
  2785  //
  2786  //	string userId The Id of the User for which you're disabling two-factor authentication.
  2787  //	TwoFactorDisableRequest request The request information that contains the code and methodId along with any event information.
  2788  func (c *FusionAuthClient) DisableTwoFactorWithRequest(userId string, request TwoFactorDisableRequest) (*BaseHTTPResponse, *Errors, error) {
  2789  	return c.DisableTwoFactorWithRequestWithContext(context.TODO(), userId, request)
  2790  }
  2791  
  2792  // DisableTwoFactorWithRequestWithContext
  2793  // Disable two-factor authentication for a user using a JSON body rather than URL parameters.
  2794  //
  2795  //	string userId The Id of the User for which you're disabling two-factor authentication.
  2796  //	TwoFactorDisableRequest request The request information that contains the code and methodId along with any event information.
  2797  func (c *FusionAuthClient) DisableTwoFactorWithRequestWithContext(ctx context.Context, userId string, request TwoFactorDisableRequest) (*BaseHTTPResponse, *Errors, error) {
  2798  	var resp BaseHTTPResponse
  2799  	var errors Errors
  2800  
  2801  	restClient := c.Start(&resp, &errors)
  2802  	err := restClient.WithUri("/api/user/two-factor").
  2803  		WithUriSegment(userId).
  2804  		WithJSONBody(request).
  2805  		WithMethod(http.MethodDelete).
  2806  		Do(ctx)
  2807  	if restClient.ErrorRef == nil {
  2808  		return &resp, nil, err
  2809  	}
  2810  	return &resp, &errors, err
  2811  }
  2812  
  2813  // EnableTwoFactor
  2814  // Enable two-factor authentication for a user.
  2815  //
  2816  //	string userId The Id of the user to enable two-factor authentication.
  2817  //	TwoFactorRequest request The two-factor enable request information.
  2818  func (c *FusionAuthClient) EnableTwoFactor(userId string, request TwoFactorRequest) (*TwoFactorResponse, *Errors, error) {
  2819  	return c.EnableTwoFactorWithContext(context.TODO(), userId, request)
  2820  }
  2821  
  2822  // EnableTwoFactorWithContext
  2823  // Enable two-factor authentication for a user.
  2824  //
  2825  //	string userId The Id of the user to enable two-factor authentication.
  2826  //	TwoFactorRequest request The two-factor enable request information.
  2827  func (c *FusionAuthClient) EnableTwoFactorWithContext(ctx context.Context, userId string, request TwoFactorRequest) (*TwoFactorResponse, *Errors, error) {
  2828  	var resp TwoFactorResponse
  2829  	var errors Errors
  2830  
  2831  	restClient := c.Start(&resp, &errors)
  2832  	err := restClient.WithUri("/api/user/two-factor").
  2833  		WithUriSegment(userId).
  2834  		WithJSONBody(request).
  2835  		WithMethod(http.MethodPost).
  2836  		Do(ctx)
  2837  	if restClient.ErrorRef == nil {
  2838  		return &resp, nil, err
  2839  	}
  2840  	return &resp, &errors, err
  2841  }
  2842  
  2843  // ExchangeOAuthCodeForAccessToken
  2844  // Exchanges an OAuth authorization code for an access token.
  2845  // Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
  2846  //
  2847  //	string code The authorization code returned on the /oauth2/authorize response.
  2848  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.
  2849  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  2850  //	string clientSecret (Optional) The client secret. This value will be required if client authentication is enabled.
  2851  //	string redirectUri The URI to redirect to upon a successful request.
  2852  func (c *FusionAuthClient) ExchangeOAuthCodeForAccessToken(code string, clientId string, clientSecret string, redirectUri string) (*AccessToken, *OAuthError, error) {
  2853  	return c.ExchangeOAuthCodeForAccessTokenWithContext(context.TODO(), code, clientId, clientSecret, redirectUri)
  2854  }
  2855  
  2856  // ExchangeOAuthCodeForAccessTokenWithContext
  2857  // Exchanges an OAuth authorization code for an access token.
  2858  // Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
  2859  //
  2860  //	string code The authorization code returned on the /oauth2/authorize response.
  2861  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.
  2862  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  2863  //	string clientSecret (Optional) The client secret. This value will be required if client authentication is enabled.
  2864  //	string redirectUri The URI to redirect to upon a successful request.
  2865  func (c *FusionAuthClient) ExchangeOAuthCodeForAccessTokenWithContext(ctx context.Context, code string, clientId string, clientSecret string, redirectUri string) (*AccessToken, *OAuthError, error) {
  2866  	var resp AccessToken
  2867  	var errors OAuthError
  2868  	formBody := url.Values{}
  2869  	formBody.Set("code", code)
  2870  	formBody.Set("client_id", clientId)
  2871  	formBody.Set("client_secret", clientSecret)
  2872  	formBody.Set("grant_type", "authorization_code")
  2873  	formBody.Set("redirect_uri", redirectUri)
  2874  
  2875  	restClient := c.StartAnonymous(&resp, &errors)
  2876  	err := restClient.WithUri("/oauth2/token").
  2877  		WithFormData(formBody).
  2878  		WithMethod(http.MethodPost).
  2879  		Do(ctx)
  2880  	if restClient.ErrorRef == nil {
  2881  		return &resp, nil, err
  2882  	}
  2883  	return &resp, &errors, err
  2884  }
  2885  
  2886  // ExchangeOAuthCodeForAccessTokenUsingPKCE
  2887  // Exchanges an OAuth authorization code and code_verifier for an access token.
  2888  // Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token.
  2889  //
  2890  //	string code The authorization code returned on the /oauth2/authorize response.
  2891  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
  2892  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  2893  //	string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
  2894  //	string redirectUri The URI to redirect to upon a successful request.
  2895  //	string codeVerifier The random string generated previously. Will be compared with the code_challenge sent previously, which allows the OAuth provider to authenticate your app.
  2896  func (c *FusionAuthClient) ExchangeOAuthCodeForAccessTokenUsingPKCE(code string, clientId string, clientSecret string, redirectUri string, codeVerifier string) (*AccessToken, *OAuthError, error) {
  2897  	return c.ExchangeOAuthCodeForAccessTokenUsingPKCEWithContext(context.TODO(), code, clientId, clientSecret, redirectUri, codeVerifier)
  2898  }
  2899  
  2900  // ExchangeOAuthCodeForAccessTokenUsingPKCEWithContext
  2901  // Exchanges an OAuth authorization code and code_verifier for an access token.
  2902  // Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token.
  2903  //
  2904  //	string code The authorization code returned on the /oauth2/authorize response.
  2905  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
  2906  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  2907  //	string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
  2908  //	string redirectUri The URI to redirect to upon a successful request.
  2909  //	string codeVerifier The random string generated previously. Will be compared with the code_challenge sent previously, which allows the OAuth provider to authenticate your app.
  2910  func (c *FusionAuthClient) ExchangeOAuthCodeForAccessTokenUsingPKCEWithContext(ctx context.Context, code string, clientId string, clientSecret string, redirectUri string, codeVerifier string) (*AccessToken, *OAuthError, error) {
  2911  	var resp AccessToken
  2912  	var errors OAuthError
  2913  	formBody := url.Values{}
  2914  	formBody.Set("code", code)
  2915  	formBody.Set("client_id", clientId)
  2916  	formBody.Set("client_secret", clientSecret)
  2917  	formBody.Set("grant_type", "authorization_code")
  2918  	formBody.Set("redirect_uri", redirectUri)
  2919  	formBody.Set("code_verifier", codeVerifier)
  2920  
  2921  	restClient := c.StartAnonymous(&resp, &errors)
  2922  	err := restClient.WithUri("/oauth2/token").
  2923  		WithFormData(formBody).
  2924  		WithMethod(http.MethodPost).
  2925  		Do(ctx)
  2926  	if restClient.ErrorRef == nil {
  2927  		return &resp, nil, err
  2928  	}
  2929  	return &resp, &errors, err
  2930  }
  2931  
  2932  // ExchangeRefreshTokenForAccessToken
  2933  // Exchange a Refresh Token for an Access Token.
  2934  // If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token.
  2935  //
  2936  //	string refreshToken The refresh token that you would like to use to exchange for an access token.
  2937  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
  2938  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  2939  //	string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
  2940  //	string scope (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.
  2941  //	string userCode (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.
  2942  func (c *FusionAuthClient) ExchangeRefreshTokenForAccessToken(refreshToken string, clientId string, clientSecret string, scope string, userCode string) (*AccessToken, *OAuthError, error) {
  2943  	return c.ExchangeRefreshTokenForAccessTokenWithContext(context.TODO(), refreshToken, clientId, clientSecret, scope, userCode)
  2944  }
  2945  
  2946  // ExchangeRefreshTokenForAccessTokenWithContext
  2947  // Exchange a Refresh Token for an Access Token.
  2948  // If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token.
  2949  //
  2950  //	string refreshToken The refresh token that you would like to use to exchange for an access token.
  2951  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
  2952  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  2953  //	string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
  2954  //	string scope (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.
  2955  //	string userCode (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.
  2956  func (c *FusionAuthClient) ExchangeRefreshTokenForAccessTokenWithContext(ctx context.Context, refreshToken string, clientId string, clientSecret string, scope string, userCode string) (*AccessToken, *OAuthError, error) {
  2957  	var resp AccessToken
  2958  	var errors OAuthError
  2959  	formBody := url.Values{}
  2960  	formBody.Set("refresh_token", refreshToken)
  2961  	formBody.Set("client_id", clientId)
  2962  	formBody.Set("client_secret", clientSecret)
  2963  	formBody.Set("grant_type", "refresh_token")
  2964  	formBody.Set("scope", scope)
  2965  	formBody.Set("user_code", userCode)
  2966  
  2967  	restClient := c.StartAnonymous(&resp, &errors)
  2968  	err := restClient.WithUri("/oauth2/token").
  2969  		WithFormData(formBody).
  2970  		WithMethod(http.MethodPost).
  2971  		Do(ctx)
  2972  	if restClient.ErrorRef == nil {
  2973  		return &resp, nil, err
  2974  	}
  2975  	return &resp, &errors, err
  2976  }
  2977  
  2978  // ExchangeRefreshTokenForJWT
  2979  // Exchange a refresh token for a new JWT.
  2980  //
  2981  //	RefreshRequest request The refresh request.
  2982  func (c *FusionAuthClient) ExchangeRefreshTokenForJWT(request RefreshRequest) (*JWTRefreshResponse, *Errors, error) {
  2983  	return c.ExchangeRefreshTokenForJWTWithContext(context.TODO(), request)
  2984  }
  2985  
  2986  // ExchangeRefreshTokenForJWTWithContext
  2987  // Exchange a refresh token for a new JWT.
  2988  //
  2989  //	RefreshRequest request The refresh request.
  2990  func (c *FusionAuthClient) ExchangeRefreshTokenForJWTWithContext(ctx context.Context, request RefreshRequest) (*JWTRefreshResponse, *Errors, error) {
  2991  	var resp JWTRefreshResponse
  2992  	var errors Errors
  2993  
  2994  	restClient := c.StartAnonymous(&resp, &errors)
  2995  	err := restClient.WithUri("/api/jwt/refresh").
  2996  		WithJSONBody(request).
  2997  		WithMethod(http.MethodPost).
  2998  		Do(ctx)
  2999  	if restClient.ErrorRef == nil {
  3000  		return &resp, nil, err
  3001  	}
  3002  	return &resp, &errors, err
  3003  }
  3004  
  3005  // ExchangeUserCredentialsForAccessToken
  3006  // Exchange User Credentials for a Token.
  3007  // If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token.
  3008  //
  3009  //	string username The login identifier of the user. The login identifier can be either the email or the username.
  3010  //	string password The user’s password.
  3011  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
  3012  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  3013  //	string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
  3014  //	string scope (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.
  3015  //	string userCode (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.
  3016  func (c *FusionAuthClient) ExchangeUserCredentialsForAccessToken(username string, password string, clientId string, clientSecret string, scope string, userCode string) (*AccessToken, *OAuthError, error) {
  3017  	return c.ExchangeUserCredentialsForAccessTokenWithContext(context.TODO(), username, password, clientId, clientSecret, scope, userCode)
  3018  }
  3019  
  3020  // ExchangeUserCredentialsForAccessTokenWithContext
  3021  // Exchange User Credentials for a Token.
  3022  // If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token.
  3023  //
  3024  //	string username The login identifier of the user. The login identifier can be either the email or the username.
  3025  //	string password The user’s password.
  3026  //	string clientId (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
  3027  //	This parameter is optional when Basic Authorization is used to authenticate this request.
  3028  //	string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
  3029  //	string scope (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.
  3030  //	string userCode (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.
  3031  func (c *FusionAuthClient) ExchangeUserCredentialsForAccessTokenWithContext(ctx context.Context, username string, password string, clientId string, clientSecret string, scope string, userCode string) (*AccessToken, *OAuthError, error) {
  3032  	var resp AccessToken
  3033  	var errors OAuthError
  3034  	formBody := url.Values{}
  3035  	formBody.Set("username", username)
  3036  	formBody.Set("password", password)
  3037  	formBody.Set("client_id", clientId)
  3038  	formBody.Set("client_secret", clientSecret)
  3039  	formBody.Set("grant_type", "password")
  3040  	formBody.Set("scope", scope)
  3041  	formBody.Set("user_code", userCode)
  3042  
  3043  	restClient := c.StartAnonymous(&resp, &errors)
  3044  	err := restClient.WithUri("/oauth2/token").
  3045  		WithFormData(formBody).
  3046  		WithMethod(http.MethodPost).
  3047  		Do(ctx)
  3048  	if restClient.ErrorRef == nil {
  3049  		return &resp, nil, err
  3050  	}
  3051  	return &resp, &errors, err
  3052  }
  3053  
  3054  // ForgotPassword
  3055  // Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
  3056  //
  3057  //	ForgotPasswordRequest request The request that contains the information about the user so that they can be emailed.
  3058  func (c *FusionAuthClient) ForgotPassword(request ForgotPasswordRequest) (*ForgotPasswordResponse, *Errors, error) {
  3059  	return c.ForgotPasswordWithContext(context.TODO(), request)
  3060  }
  3061  
  3062  // ForgotPasswordWithContext
  3063  // Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
  3064  //
  3065  //	ForgotPasswordRequest request The request that contains the information about the user so that they can be emailed.
  3066  func (c *FusionAuthClient) ForgotPasswordWithContext(ctx context.Context, request ForgotPasswordRequest) (*ForgotPasswordResponse, *Errors, error) {
  3067  	var resp ForgotPasswordResponse
  3068  	var errors Errors
  3069  
  3070  	restClient := c.Start(&resp, &errors)
  3071  	err := restClient.WithUri("/api/user/forgot-password").
  3072  		WithJSONBody(request).
  3073  		WithMethod(http.MethodPost).
  3074  		Do(ctx)
  3075  	if restClient.ErrorRef == nil {
  3076  		return &resp, nil, err
  3077  	}
  3078  	return &resp, &errors, err
  3079  }
  3080  
  3081  // GenerateEmailVerificationId
  3082  // Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an
  3083  // email to the User. This API may be used to collect the verificationId for use with a third party system.
  3084  //
  3085  //	string email The email address of the user that needs a new verification email.
  3086  func (c *FusionAuthClient) GenerateEmailVerificationId(email string) (*VerifyEmailResponse, error) {
  3087  	return c.GenerateEmailVerificationIdWithContext(context.TODO(), email)
  3088  }
  3089  
  3090  // GenerateEmailVerificationIdWithContext
  3091  // Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an
  3092  // email to the User. This API may be used to collect the verificationId for use with a third party system.
  3093  //
  3094  //	string email The email address of the user that needs a new verification email.
  3095  func (c *FusionAuthClient) GenerateEmailVerificationIdWithContext(ctx context.Context, email string) (*VerifyEmailResponse, error) {
  3096  	var resp VerifyEmailResponse
  3097  
  3098  	err := c.Start(&resp, nil).
  3099  		WithUri("/api/user/verify-email").
  3100  		WithParameter("email", email).
  3101  		WithParameter("sendVerifyEmail", strconv.FormatBool(false)).
  3102  		WithMethod(http.MethodPut).
  3103  		Do(ctx)
  3104  	return &resp, err
  3105  }
  3106  
  3107  // GenerateKey
  3108  // Generate a new RSA or EC key pair or an HMAC secret.
  3109  //
  3110  //	string keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated.
  3111  //	KeyRequest request The request object that contains all the information used to create the key.
  3112  func (c *FusionAuthClient) GenerateKey(keyId string, request KeyRequest) (*KeyResponse, *Errors, error) {
  3113  	return c.GenerateKeyWithContext(context.TODO(), keyId, request)
  3114  }
  3115  
  3116  // GenerateKeyWithContext
  3117  // Generate a new RSA or EC key pair or an HMAC secret.
  3118  //
  3119  //	string keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated.
  3120  //	KeyRequest request The request object that contains all the information used to create the key.
  3121  func (c *FusionAuthClient) GenerateKeyWithContext(ctx context.Context, keyId string, request KeyRequest) (*KeyResponse, *Errors, error) {
  3122  	var resp KeyResponse
  3123  	var errors Errors
  3124  
  3125  	restClient := c.Start(&resp, &errors)
  3126  	err := restClient.WithUri("/api/key/generate").
  3127  		WithUriSegment(keyId).
  3128  		WithJSONBody(request).
  3129  		WithMethod(http.MethodPost).
  3130  		Do(ctx)
  3131  	if restClient.ErrorRef == nil {
  3132  		return &resp, nil, err
  3133  	}
  3134  	return &resp, &errors, err
  3135  }
  3136  
  3137  // GenerateRegistrationVerificationId
  3138  // Generate a new Application Registration Verification Id to be used with the Verify Registration API. This API will not attempt to send an
  3139  // email to the User. This API may be used to collect the verificationId for use with a third party system.
  3140  //
  3141  //	string email The email address of the user that needs a new verification email.
  3142  //	string applicationId The Id of the application to be verified.
  3143  func (c *FusionAuthClient) GenerateRegistrationVerificationId(email string, applicationId string) (*VerifyRegistrationResponse, error) {
  3144  	return c.GenerateRegistrationVerificationIdWithContext(context.TODO(), email, applicationId)
  3145  }
  3146  
  3147  // GenerateRegistrationVerificationIdWithContext
  3148  // Generate a new Application Registration Verification Id to be used with the Verify Registration API. This API will not attempt to send an
  3149  // email to the User. This API may be used to collect the verificationId for use with a third party system.
  3150  //
  3151  //	string email The email address of the user that needs a new verification email.
  3152  //	string applicationId The Id of the application to be verified.
  3153  func (c *FusionAuthClient) GenerateRegistrationVerificationIdWithContext(ctx context.Context, email string, applicationId string) (*VerifyRegistrationResponse, error) {
  3154  	var resp VerifyRegistrationResponse
  3155  
  3156  	err := c.Start(&resp, nil).
  3157  		WithUri("/api/user/verify-registration").
  3158  		WithParameter("email", email).
  3159  		WithParameter("sendVerifyPasswordEmail", strconv.FormatBool(false)).
  3160  		WithParameter("applicationId", applicationId).
  3161  		WithMethod(http.MethodPut).
  3162  		Do(ctx)
  3163  	return &resp, err
  3164  }
  3165  
  3166  // GenerateTwoFactorRecoveryCodes
  3167  // Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
  3168  //
  3169  //	string userId The Id of the user to generate new Two Factor recovery codes.
  3170  func (c *FusionAuthClient) GenerateTwoFactorRecoveryCodes(userId string) (*TwoFactorRecoveryCodeResponse, *Errors, error) {
  3171  	return c.GenerateTwoFactorRecoveryCodesWithContext(context.TODO(), userId)
  3172  }
  3173  
  3174  // GenerateTwoFactorRecoveryCodesWithContext
  3175  // Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
  3176  //
  3177  //	string userId The Id of the user to generate new Two Factor recovery codes.
  3178  func (c *FusionAuthClient) GenerateTwoFactorRecoveryCodesWithContext(ctx context.Context, userId string) (*TwoFactorRecoveryCodeResponse, *Errors, error) {
  3179  	var resp TwoFactorRecoveryCodeResponse
  3180  	var errors Errors
  3181  
  3182  	restClient := c.Start(&resp, &errors)
  3183  	err := restClient.WithUri("/api/user/two-factor/recovery-code").
  3184  		WithUriSegment(userId).
  3185  		WithMethod(http.MethodPost).
  3186  		Do(ctx)
  3187  	if restClient.ErrorRef == nil {
  3188  		return &resp, nil, err
  3189  	}
  3190  	return &resp, &errors, err
  3191  }
  3192  
  3193  // GenerateTwoFactorSecret
  3194  // Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain
  3195  // both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication
  3196  // application such as Google Authenticator.
  3197  func (c *FusionAuthClient) GenerateTwoFactorSecret() (*SecretResponse, error) {
  3198  	return c.GenerateTwoFactorSecretWithContext(context.TODO())
  3199  }
  3200  
  3201  // GenerateTwoFactorSecretWithContext
  3202  // Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain
  3203  // both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication
  3204  // application such as Google Authenticator.
  3205  func (c *FusionAuthClient) GenerateTwoFactorSecretWithContext(ctx context.Context) (*SecretResponse, error) {
  3206  	var resp SecretResponse
  3207  
  3208  	err := c.Start(&resp, nil).
  3209  		WithUri("/api/two-factor/secret").
  3210  		WithMethod(http.MethodGet).
  3211  		Do(ctx)
  3212  	return &resp, err
  3213  }
  3214  
  3215  // GenerateTwoFactorSecretUsingJWT
  3216  // Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain
  3217  // both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication
  3218  // application such as Google Authenticator.
  3219  //
  3220  //	string encodedJWT The encoded JWT (access token).
  3221  func (c *FusionAuthClient) GenerateTwoFactorSecretUsingJWT(encodedJWT string) (*SecretResponse, error) {
  3222  	return c.GenerateTwoFactorSecretUsingJWTWithContext(context.TODO(), encodedJWT)
  3223  }
  3224  
  3225  // GenerateTwoFactorSecretUsingJWTWithContext
  3226  // Generate a Two Factor secret that can be used to enable Two Factor authentication for a User. The response will contain
  3227  // both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication
  3228  // application such as Google Authenticator.
  3229  //
  3230  //	string encodedJWT The encoded JWT (access token).
  3231  func (c *FusionAuthClient) GenerateTwoFactorSecretUsingJWTWithContext(ctx context.Context, encodedJWT string) (*SecretResponse, error) {
  3232  	var resp SecretResponse
  3233  
  3234  	err := c.StartAnonymous(&resp, nil).
  3235  		WithUri("/api/two-factor/secret").
  3236  		WithAuthorization("Bearer " + encodedJWT).
  3237  		WithMethod(http.MethodGet).
  3238  		Do(ctx)
  3239  	return &resp, err
  3240  }
  3241  
  3242  // IdentityProviderLogin
  3243  // Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other
  3244  // login systems.
  3245  //
  3246  //	IdentityProviderLoginRequest request The third-party login request that contains information from the third-party login
  3247  //	providers that FusionAuth uses to reconcile the user's account.
  3248  func (c *FusionAuthClient) IdentityProviderLogin(request IdentityProviderLoginRequest) (*LoginResponse, *Errors, error) {
  3249  	return c.IdentityProviderLoginWithContext(context.TODO(), request)
  3250  }
  3251  
  3252  // IdentityProviderLoginWithContext
  3253  // Handles login via third-parties including Social login, external OAuth and OpenID Connect, and other
  3254  // login systems.
  3255  //
  3256  //	IdentityProviderLoginRequest request The third-party login request that contains information from the third-party login
  3257  //	providers that FusionAuth uses to reconcile the user's account.
  3258  func (c *FusionAuthClient) IdentityProviderLoginWithContext(ctx context.Context, request IdentityProviderLoginRequest) (*LoginResponse, *Errors, error) {
  3259  	var resp LoginResponse
  3260  	var errors Errors
  3261  
  3262  	restClient := c.StartAnonymous(&resp, &errors)
  3263  	err := restClient.WithUri("/api/identity-provider/login").
  3264  		WithJSONBody(request).
  3265  		WithMethod(http.MethodPost).
  3266  		Do(ctx)
  3267  	if restClient.ErrorRef == nil {
  3268  		return &resp, nil, err
  3269  	}
  3270  	return &resp, &errors, err
  3271  }
  3272  
  3273  // ImportKey
  3274  // Import an existing RSA or EC key pair or an HMAC secret.
  3275  //
  3276  //	string keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated.
  3277  //	KeyRequest request The request object that contains all the information used to create the key.
  3278  func (c *FusionAuthClient) ImportKey(keyId string, request KeyRequest) (*KeyResponse, *Errors, error) {
  3279  	return c.ImportKeyWithContext(context.TODO(), keyId, request)
  3280  }
  3281  
  3282  // ImportKeyWithContext
  3283  // Import an existing RSA or EC key pair or an HMAC secret.
  3284  //
  3285  //	string keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated.
  3286  //	KeyRequest request The request object that contains all the information used to create the key.
  3287  func (c *FusionAuthClient) ImportKeyWithContext(ctx context.Context, keyId string, request KeyRequest) (*KeyResponse, *Errors, error) {
  3288  	var resp KeyResponse
  3289  	var errors Errors
  3290  
  3291  	restClient := c.Start(&resp, &errors)
  3292  	err := restClient.WithUri("/api/key/import").
  3293  		WithUriSegment(keyId).
  3294  		WithJSONBody(request).
  3295  		WithMethod(http.MethodPost).
  3296  		Do(ctx)
  3297  	if restClient.ErrorRef == nil {
  3298  		return &resp, nil, err
  3299  	}
  3300  	return &resp, &errors, err
  3301  }
  3302  
  3303  // ImportRefreshTokens
  3304  // Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the
  3305  // expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth
  3306  // Application. This is done to increases the insert performance.
  3307  //
  3308  // Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic
  3309  // explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
  3310  // body with specific validation errors. This will slow the request down but will allow you to identify the cause of
  3311  // the failure. See the validateDbConstraints request parameter.
  3312  //
  3313  //	RefreshTokenImportRequest request The request that contains all the information about all the refresh tokens to import.
  3314  func (c *FusionAuthClient) ImportRefreshTokens(request RefreshTokenImportRequest) (*BaseHTTPResponse, *Errors, error) {
  3315  	return c.ImportRefreshTokensWithContext(context.TODO(), request)
  3316  }
  3317  
  3318  // ImportRefreshTokensWithContext
  3319  // Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the
  3320  // expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth
  3321  // Application. This is done to increases the insert performance.
  3322  //
  3323  // Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic
  3324  // explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
  3325  // body with specific validation errors. This will slow the request down but will allow you to identify the cause of
  3326  // the failure. See the validateDbConstraints request parameter.
  3327  //
  3328  //	RefreshTokenImportRequest request The request that contains all the information about all the refresh tokens to import.
  3329  func (c *FusionAuthClient) ImportRefreshTokensWithContext(ctx context.Context, request RefreshTokenImportRequest) (*BaseHTTPResponse, *Errors, error) {
  3330  	var resp BaseHTTPResponse
  3331  	var errors Errors
  3332  
  3333  	restClient := c.Start(&resp, &errors)
  3334  	err := restClient.WithUri("/api/user/refresh-token/import").
  3335  		WithJSONBody(request).
  3336  		WithMethod(http.MethodPost).
  3337  		Do(ctx)
  3338  	if restClient.ErrorRef == nil {
  3339  		return &resp, nil, err
  3340  	}
  3341  	return &resp, &errors, err
  3342  }
  3343  
  3344  // ImportUsers
  3345  // Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation
  3346  // that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to
  3347  // increases the insert performance.
  3348  //
  3349  // Therefore, if you encounter an error due to a database key violation, the response will likely offer
  3350  // a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
  3351  // body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See
  3352  // the validateDbConstraints request parameter.
  3353  //
  3354  //	ImportRequest request The request that contains all the information about all the users to import.
  3355  func (c *FusionAuthClient) ImportUsers(request ImportRequest) (*BaseHTTPResponse, *Errors, error) {
  3356  	return c.ImportUsersWithContext(context.TODO(), request)
  3357  }
  3358  
  3359  // ImportUsersWithContext
  3360  // Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation
  3361  // that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to
  3362  // increases the insert performance.
  3363  //
  3364  // Therefore, if you encounter an error due to a database key violation, the response will likely offer
  3365  // a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
  3366  // body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See
  3367  // the validateDbConstraints request parameter.
  3368  //
  3369  //	ImportRequest request The request that contains all the information about all the users to import.
  3370  func (c *FusionAuthClient) ImportUsersWithContext(ctx context.Context, request ImportRequest) (*BaseHTTPResponse, *Errors, error) {
  3371  	var resp BaseHTTPResponse
  3372  	var errors Errors
  3373  
  3374  	restClient := c.Start(&resp, &errors)
  3375  	err := restClient.WithUri("/api/user/import").
  3376  		WithJSONBody(request).
  3377  		WithMethod(http.MethodPost).
  3378  		Do(ctx)
  3379  	if restClient.ErrorRef == nil {
  3380  		return &resp, nil, err
  3381  	}
  3382  	return &resp, &errors, err
  3383  }
  3384  
  3385  // ImportWebAuthnCredential
  3386  // Import a WebAuthn credential
  3387  //
  3388  //	WebAuthnCredentialImportRequest request An object containing data necessary for importing the credential
  3389  func (c *FusionAuthClient) ImportWebAuthnCredential(request WebAuthnCredentialImportRequest) (*BaseHTTPResponse, *Errors, error) {
  3390  	return c.ImportWebAuthnCredentialWithContext(context.TODO(), request)
  3391  }
  3392  
  3393  // ImportWebAuthnCredentialWithContext
  3394  // Import a WebAuthn credential
  3395  //
  3396  //	WebAuthnCredentialImportRequest request An object containing data necessary for importing the credential
  3397  func (c *FusionAuthClient) ImportWebAuthnCredentialWithContext(ctx context.Context, request WebAuthnCredentialImportRequest) (*BaseHTTPResponse, *Errors, error) {
  3398  	var resp BaseHTTPResponse
  3399  	var errors Errors
  3400  
  3401  	restClient := c.Start(&resp, &errors)
  3402  	err := restClient.WithUri("/api/webauthn/import").
  3403  		WithJSONBody(request).
  3404  		WithMethod(http.MethodPost).
  3405  		Do(ctx)
  3406  	if restClient.ErrorRef == nil {
  3407  		return &resp, nil, err
  3408  	}
  3409  	return &resp, &errors, err
  3410  }
  3411  
  3412  // IssueJWT
  3413  // Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid
  3414  // access token is properly signed and not expired.
  3415  // <p>
  3416  // This API may be used in an SSO configuration to issue new tokens for another application after the user has
  3417  // obtained a valid token from authentication.
  3418  //
  3419  //	string applicationId The Application Id for which you are requesting a new access token be issued.
  3420  //	string encodedJWT The encoded JWT (access token).
  3421  //	string refreshToken (Optional) An existing refresh token used to request a refresh token in addition to a JWT in the response.
  3422  //	<p>The target application represented by the applicationId request parameter must have refresh
  3423  //	tokens enabled in order to receive a refresh token in the response.</p>
  3424  func (c *FusionAuthClient) IssueJWT(applicationId string, encodedJWT string, refreshToken string) (*IssueResponse, *Errors, error) {
  3425  	return c.IssueJWTWithContext(context.TODO(), applicationId, encodedJWT, refreshToken)
  3426  }
  3427  
  3428  // IssueJWTWithContext
  3429  // Issue a new access token (JWT) for the requested Application after ensuring the provided JWT is valid. A valid
  3430  // access token is properly signed and not expired.
  3431  // <p>
  3432  // This API may be used in an SSO configuration to issue new tokens for another application after the user has
  3433  // obtained a valid token from authentication.
  3434  //
  3435  //	string applicationId The Application Id for which you are requesting a new access token be issued.
  3436  //	string encodedJWT The encoded JWT (access token).
  3437  //	string refreshToken (Optional) An existing refresh token used to request a refresh token in addition to a JWT in the response.
  3438  //	<p>The target application represented by the applicationId request parameter must have refresh
  3439  //	tokens enabled in order to receive a refresh token in the response.</p>
  3440  func (c *FusionAuthClient) IssueJWTWithContext(ctx context.Context, applicationId string, encodedJWT string, refreshToken string) (*IssueResponse, *Errors, error) {
  3441  	var resp IssueResponse
  3442  	var errors Errors
  3443  
  3444  	restClient := c.StartAnonymous(&resp, &errors)
  3445  	err := restClient.WithUri("/api/jwt/issue").
  3446  		WithAuthorization("Bearer "+encodedJWT).
  3447  		WithParameter("applicationId", applicationId).
  3448  		WithParameter("refreshToken", refreshToken).
  3449  		WithMethod(http.MethodGet).
  3450  		Do(ctx)
  3451  	if restClient.ErrorRef == nil {
  3452  		return &resp, nil, err
  3453  	}
  3454  	return &resp, &errors, err
  3455  }
  3456  
  3457  // Login
  3458  // Authenticates a user to FusionAuth.
  3459  //
  3460  // This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
  3461  //
  3462  //	LoginRequest request The login request that contains the user credentials used to log them in.
  3463  func (c *FusionAuthClient) Login(request LoginRequest) (*LoginResponse, *Errors, error) {
  3464  	return c.LoginWithContext(context.TODO(), request)
  3465  }
  3466  
  3467  // LoginWithContext
  3468  // Authenticates a user to FusionAuth.
  3469  //
  3470  // This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
  3471  //
  3472  //	LoginRequest request The login request that contains the user credentials used to log them in.
  3473  func (c *FusionAuthClient) LoginWithContext(ctx context.Context, request LoginRequest) (*LoginResponse, *Errors, error) {
  3474  	var resp LoginResponse
  3475  	var errors Errors
  3476  
  3477  	restClient := c.Start(&resp, &errors)
  3478  	err := restClient.WithUri("/api/login").
  3479  		WithJSONBody(request).
  3480  		WithMethod(http.MethodPost).
  3481  		Do(ctx)
  3482  	if restClient.ErrorRef == nil {
  3483  		return &resp, nil, err
  3484  	}
  3485  	return &resp, &errors, err
  3486  }
  3487  
  3488  // LoginPing
  3489  // Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using
  3490  // FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an
  3491  // application where they no longer have a session. This helps correctly track login counts, times and helps with
  3492  // reporting.
  3493  //
  3494  //	string userId The Id of the user that was logged in.
  3495  //	string applicationId The Id of the application that they logged into.
  3496  //	string callerIPAddress (Optional) The IP address of the end-user that is logging in. If a null value is provided
  3497  //	the IP address will be that of the client or last proxy that sent the request.
  3498  func (c *FusionAuthClient) LoginPing(userId string, applicationId string, callerIPAddress string) (*LoginResponse, *Errors, error) {
  3499  	return c.LoginPingWithContext(context.TODO(), userId, applicationId, callerIPAddress)
  3500  }
  3501  
  3502  // LoginPingWithContext
  3503  // Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using
  3504  // FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an
  3505  // application where they no longer have a session. This helps correctly track login counts, times and helps with
  3506  // reporting.
  3507  //
  3508  //	string userId The Id of the user that was logged in.
  3509  //	string applicationId The Id of the application that they logged into.
  3510  //	string callerIPAddress (Optional) The IP address of the end-user that is logging in. If a null value is provided
  3511  //	the IP address will be that of the client or last proxy that sent the request.
  3512  func (c *FusionAuthClient) LoginPingWithContext(ctx context.Context, userId string, applicationId string, callerIPAddress string) (*LoginResponse, *Errors, error) {
  3513  	var resp LoginResponse
  3514  	var errors Errors
  3515  
  3516  	restClient := c.Start(&resp, &errors)
  3517  	err := restClient.WithUri("/api/login").
  3518  		WithUriSegment(userId).
  3519  		WithUriSegment(applicationId).
  3520  		WithParameter("ipAddress", callerIPAddress).
  3521  		WithMethod(http.MethodPut).
  3522  		Do(ctx)
  3523  	if restClient.ErrorRef == nil {
  3524  		return &resp, nil, err
  3525  	}
  3526  	return &resp, &errors, err
  3527  }
  3528  
  3529  // LoginPingWithRequest
  3530  // Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using
  3531  // FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an
  3532  // application where they no longer have a session. This helps correctly track login counts, times and helps with
  3533  // reporting.
  3534  //
  3535  //	LoginPingRequest request The login request that contains the user credentials used to log them in.
  3536  func (c *FusionAuthClient) LoginPingWithRequest(request LoginPingRequest) (*LoginResponse, *Errors, error) {
  3537  	return c.LoginPingWithRequestWithContext(context.TODO(), request)
  3538  }
  3539  
  3540  // LoginPingWithRequestWithContext
  3541  // Sends a ping to FusionAuth indicating that the user was automatically logged into an application. When using
  3542  // FusionAuth's SSO or your own, you should call this if the user is already logged in centrally, but accesses an
  3543  // application where they no longer have a session. This helps correctly track login counts, times and helps with
  3544  // reporting.
  3545  //
  3546  //	LoginPingRequest request The login request that contains the user credentials used to log them in.
  3547  func (c *FusionAuthClient) LoginPingWithRequestWithContext(ctx context.Context, request LoginPingRequest) (*LoginResponse, *Errors, error) {
  3548  	var resp LoginResponse
  3549  	var errors Errors
  3550  
  3551  	restClient := c.Start(&resp, &errors)
  3552  	err := restClient.WithUri("/api/login").
  3553  		WithJSONBody(request).
  3554  		WithMethod(http.MethodPut).
  3555  		Do(ctx)
  3556  	if restClient.ErrorRef == nil {
  3557  		return &resp, nil, err
  3558  	}
  3559  	return &resp, &errors, err
  3560  }
  3561  
  3562  // Logout
  3563  // The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the
  3564  // client and revoke the refresh token stored. This API does nothing if the request does not contain an access
  3565  // token or refresh token cookies.
  3566  //
  3567  //	bool global When this value is set to true all the refresh tokens issued to the owner of the
  3568  //	provided token will be revoked.
  3569  //	string refreshToken (Optional) The refresh_token as a request parameter instead of coming in via a cookie.
  3570  //	If provided this takes precedence over the cookie.
  3571  func (c *FusionAuthClient) Logout(global bool, refreshToken string) (*BaseHTTPResponse, error) {
  3572  	return c.LogoutWithContext(context.TODO(), global, refreshToken)
  3573  }
  3574  
  3575  // LogoutWithContext
  3576  // The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the
  3577  // client and revoke the refresh token stored. This API does nothing if the request does not contain an access
  3578  // token or refresh token cookies.
  3579  //
  3580  //	bool global When this value is set to true all the refresh tokens issued to the owner of the
  3581  //	provided token will be revoked.
  3582  //	string refreshToken (Optional) The refresh_token as a request parameter instead of coming in via a cookie.
  3583  //	If provided this takes precedence over the cookie.
  3584  func (c *FusionAuthClient) LogoutWithContext(ctx context.Context, global bool, refreshToken string) (*BaseHTTPResponse, error) {
  3585  	var resp BaseHTTPResponse
  3586  
  3587  	err := c.StartAnonymous(&resp, nil).
  3588  		WithUri("/api/logout").
  3589  		WithParameter("global", strconv.FormatBool(global)).
  3590  		WithParameter("refreshToken", refreshToken).
  3591  		WithMethod(http.MethodPost).
  3592  		Do(ctx)
  3593  	return &resp, err
  3594  }
  3595  
  3596  // LogoutWithRequest
  3597  // The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the
  3598  // client and revoke the refresh token stored. This API takes the refresh token in the JSON body.
  3599  //
  3600  //	LogoutRequest request The request object that contains all the information used to logout the user.
  3601  func (c *FusionAuthClient) LogoutWithRequest(request LogoutRequest) (*BaseHTTPResponse, error) {
  3602  	return c.LogoutWithRequestWithContext(context.TODO(), request)
  3603  }
  3604  
  3605  // LogoutWithRequestWithContext
  3606  // The Logout API is intended to be used to remove the refresh token and access token cookies if they exist on the
  3607  // client and revoke the refresh token stored. This API takes the refresh token in the JSON body.
  3608  //
  3609  //	LogoutRequest request The request object that contains all the information used to logout the user.
  3610  func (c *FusionAuthClient) LogoutWithRequestWithContext(ctx context.Context, request LogoutRequest) (*BaseHTTPResponse, error) {
  3611  	var resp BaseHTTPResponse
  3612  
  3613  	err := c.StartAnonymous(&resp, nil).
  3614  		WithUri("/api/logout").
  3615  		WithJSONBody(request).
  3616  		WithMethod(http.MethodPost).
  3617  		Do(ctx)
  3618  	return &resp, err
  3619  }
  3620  
  3621  // LookupIdentityProvider
  3622  // Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
  3623  // by a registered identity provider. A 404 indicates the domain is not managed.
  3624  //
  3625  //	string domain The domain or email address to lookup.
  3626  func (c *FusionAuthClient) LookupIdentityProvider(domain string) (*LookupResponse, error) {
  3627  	return c.LookupIdentityProviderWithContext(context.TODO(), domain)
  3628  }
  3629  
  3630  // LookupIdentityProviderWithContext
  3631  // Retrieves the identity provider for the given domain. A 200 response code indicates the domain is managed
  3632  // by a registered identity provider. A 404 indicates the domain is not managed.
  3633  //
  3634  //	string domain The domain or email address to lookup.
  3635  func (c *FusionAuthClient) LookupIdentityProviderWithContext(ctx context.Context, domain string) (*LookupResponse, error) {
  3636  	var resp LookupResponse
  3637  
  3638  	err := c.Start(&resp, nil).
  3639  		WithUri("/api/identity-provider/lookup").
  3640  		WithParameter("domain", domain).
  3641  		WithMethod(http.MethodGet).
  3642  		Do(ctx)
  3643  	return &resp, err
  3644  }
  3645  
  3646  // ModifyAction
  3647  // Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
  3648  // action.
  3649  //
  3650  //	string actionId The Id of the action to modify. This is technically the user action log id.
  3651  //	ActionRequest request The request that contains all the information about the modification.
  3652  func (c *FusionAuthClient) ModifyAction(actionId string, request ActionRequest) (*ActionResponse, *Errors, error) {
  3653  	return c.ModifyActionWithContext(context.TODO(), actionId, request)
  3654  }
  3655  
  3656  // ModifyActionWithContext
  3657  // Modifies a temporal user action by changing the expiration of the action and optionally adding a comment to the
  3658  // action.
  3659  //
  3660  //	string actionId The Id of the action to modify. This is technically the user action log id.
  3661  //	ActionRequest request The request that contains all the information about the modification.
  3662  func (c *FusionAuthClient) ModifyActionWithContext(ctx context.Context, actionId string, request ActionRequest) (*ActionResponse, *Errors, error) {
  3663  	var resp ActionResponse
  3664  	var errors Errors
  3665  
  3666  	restClient := c.Start(&resp, &errors)
  3667  	err := restClient.WithUri("/api/user/action").
  3668  		WithUriSegment(actionId).
  3669  		WithJSONBody(request).
  3670  		WithMethod(http.MethodPut).
  3671  		Do(ctx)
  3672  	if restClient.ErrorRef == nil {
  3673  		return &resp, nil, err
  3674  	}
  3675  	return &resp, &errors, err
  3676  }
  3677  
  3678  // PasswordlessLogin
  3679  // Complete a login request using a passwordless code
  3680  //
  3681  //	PasswordlessLoginRequest request The passwordless login request that contains all the information used to complete login.
  3682  func (c *FusionAuthClient) PasswordlessLogin(request PasswordlessLoginRequest) (*LoginResponse, *Errors, error) {
  3683  	return c.PasswordlessLoginWithContext(context.TODO(), request)
  3684  }
  3685  
  3686  // PasswordlessLoginWithContext
  3687  // Complete a login request using a passwordless code
  3688  //
  3689  //	PasswordlessLoginRequest request The passwordless login request that contains all the information used to complete login.
  3690  func (c *FusionAuthClient) PasswordlessLoginWithContext(ctx context.Context, request PasswordlessLoginRequest) (*LoginResponse, *Errors, error) {
  3691  	var resp LoginResponse
  3692  	var errors Errors
  3693  
  3694  	restClient := c.StartAnonymous(&resp, &errors)
  3695  	err := restClient.WithUri("/api/passwordless/login").
  3696  		WithJSONBody(request).
  3697  		WithMethod(http.MethodPost).
  3698  		Do(ctx)
  3699  	if restClient.ErrorRef == nil {
  3700  		return &resp, nil, err
  3701  	}
  3702  	return &resp, &errors, err
  3703  }
  3704  
  3705  // PatchAPIKey
  3706  // Updates an authentication API key by given id
  3707  //
  3708  //	string keyId The Id of the authentication key. If not provided a secure random api key will be generated.
  3709  //	APIKeyRequest request The request object that contains all the information needed to create the APIKey.
  3710  func (c *FusionAuthClient) PatchAPIKey(keyId string, request APIKeyRequest) (*APIKeyResponse, *Errors, error) {
  3711  	return c.PatchAPIKeyWithContext(context.TODO(), keyId, request)
  3712  }
  3713  
  3714  // PatchAPIKeyWithContext
  3715  // Updates an authentication API key by given id
  3716  //
  3717  //	string keyId The Id of the authentication key. If not provided a secure random api key will be generated.
  3718  //	APIKeyRequest request The request object that contains all the information needed to create the APIKey.
  3719  func (c *FusionAuthClient) PatchAPIKeyWithContext(ctx context.Context, keyId string, request APIKeyRequest) (*APIKeyResponse, *Errors, error) {
  3720  	var resp APIKeyResponse
  3721  	var errors Errors
  3722  
  3723  	restClient := c.Start(&resp, &errors)
  3724  	err := restClient.WithUri("/api/api-key").
  3725  		WithUriSegment(keyId).
  3726  		WithJSONBody(request).
  3727  		WithMethod(http.MethodPost).
  3728  		Do(ctx)
  3729  	if restClient.ErrorRef == nil {
  3730  		return &resp, nil, err
  3731  	}
  3732  	return &resp, &errors, err
  3733  }
  3734  
  3735  // PatchApplication
  3736  // Updates, via PATCH, the application with the given Id.
  3737  //
  3738  //	string applicationId The Id of the application to update.
  3739  //	ApplicationRequest request The request that contains just the new application information.
  3740  func (c *FusionAuthClient) PatchApplication(applicationId string, request map[string]interface{}) (*ApplicationResponse, *Errors, error) {
  3741  	return c.PatchApplicationWithContext(context.TODO(), applicationId, request)
  3742  }
  3743  
  3744  // PatchApplicationWithContext
  3745  // Updates, via PATCH, the application with the given Id.
  3746  //
  3747  //	string applicationId The Id of the application to update.
  3748  //	ApplicationRequest request The request that contains just the new application information.
  3749  func (c *FusionAuthClient) PatchApplicationWithContext(ctx context.Context, applicationId string, request map[string]interface{}) (*ApplicationResponse, *Errors, error) {
  3750  	var resp ApplicationResponse
  3751  	var errors Errors
  3752  
  3753  	restClient := c.Start(&resp, &errors)
  3754  	err := restClient.WithUri("/api/application").
  3755  		WithUriSegment(applicationId).
  3756  		WithJSONBody(request).
  3757  		WithMethod(http.MethodPatch).
  3758  		Do(ctx)
  3759  	if restClient.ErrorRef == nil {
  3760  		return &resp, nil, err
  3761  	}
  3762  	return &resp, &errors, err
  3763  }
  3764  
  3765  // PatchApplicationRole
  3766  // Updates, via PATCH, the application role with the given Id for the application.
  3767  //
  3768  //	string applicationId The Id of the application that the role belongs to.
  3769  //	string roleId The Id of the role to update.
  3770  //	ApplicationRequest request The request that contains just the new role information.
  3771  func (c *FusionAuthClient) PatchApplicationRole(applicationId string, roleId string, request map[string]interface{}) (*ApplicationResponse, *Errors, error) {
  3772  	return c.PatchApplicationRoleWithContext(context.TODO(), applicationId, roleId, request)
  3773  }
  3774  
  3775  // PatchApplicationRoleWithContext
  3776  // Updates, via PATCH, the application role with the given Id for the application.
  3777  //
  3778  //	string applicationId The Id of the application that the role belongs to.
  3779  //	string roleId The Id of the role to update.
  3780  //	ApplicationRequest request The request that contains just the new role information.
  3781  func (c *FusionAuthClient) PatchApplicationRoleWithContext(ctx context.Context, applicationId string, roleId string, request map[string]interface{}) (*ApplicationResponse, *Errors, error) {
  3782  	var resp ApplicationResponse
  3783  	var errors Errors
  3784  
  3785  	restClient := c.Start(&resp, &errors)
  3786  	err := restClient.WithUri("/api/application").
  3787  		WithUriSegment(applicationId).
  3788  		WithUriSegment("role").
  3789  		WithUriSegment(roleId).
  3790  		WithJSONBody(request).
  3791  		WithMethod(http.MethodPatch).
  3792  		Do(ctx)
  3793  	if restClient.ErrorRef == nil {
  3794  		return &resp, nil, err
  3795  	}
  3796  	return &resp, &errors, err
  3797  }
  3798  
  3799  // PatchConnector
  3800  // Updates, via PATCH, the connector with the given Id.
  3801  //
  3802  //	string connectorId The Id of the connector to update.
  3803  //	ConnectorRequest request The request that contains just the new connector information.
  3804  func (c *FusionAuthClient) PatchConnector(connectorId string, request map[string]interface{}) (*ConnectorResponse, *Errors, error) {
  3805  	return c.PatchConnectorWithContext(context.TODO(), connectorId, request)
  3806  }
  3807  
  3808  // PatchConnectorWithContext
  3809  // Updates, via PATCH, the connector with the given Id.
  3810  //
  3811  //	string connectorId The Id of the connector to update.
  3812  //	ConnectorRequest request The request that contains just the new connector information.
  3813  func (c *FusionAuthClient) PatchConnectorWithContext(ctx context.Context, connectorId string, request map[string]interface{}) (*ConnectorResponse, *Errors, error) {
  3814  	var resp ConnectorResponse
  3815  	var errors Errors
  3816  
  3817  	restClient := c.Start(&resp, &errors)
  3818  	err := restClient.WithUri("/api/connector").
  3819  		WithUriSegment(connectorId).
  3820  		WithJSONBody(request).
  3821  		WithMethod(http.MethodPatch).
  3822  		Do(ctx)
  3823  	if restClient.ErrorRef == nil {
  3824  		return &resp, nil, err
  3825  	}
  3826  	return &resp, &errors, err
  3827  }
  3828  
  3829  // PatchConsent
  3830  // Updates, via PATCH, the consent with the given Id.
  3831  //
  3832  //	string consentId The Id of the consent to update.
  3833  //	ConsentRequest request The request that contains just the new consent information.
  3834  func (c *FusionAuthClient) PatchConsent(consentId string, request map[string]interface{}) (*ConsentResponse, *Errors, error) {
  3835  	return c.PatchConsentWithContext(context.TODO(), consentId, request)
  3836  }
  3837  
  3838  // PatchConsentWithContext
  3839  // Updates, via PATCH, the consent with the given Id.
  3840  //
  3841  //	string consentId The Id of the consent to update.
  3842  //	ConsentRequest request The request that contains just the new consent information.
  3843  func (c *FusionAuthClient) PatchConsentWithContext(ctx context.Context, consentId string, request map[string]interface{}) (*ConsentResponse, *Errors, error) {
  3844  	var resp ConsentResponse
  3845  	var errors Errors
  3846  
  3847  	restClient := c.Start(&resp, &errors)
  3848  	err := restClient.WithUri("/api/consent").
  3849  		WithUriSegment(consentId).
  3850  		WithJSONBody(request).
  3851  		WithMethod(http.MethodPatch).
  3852  		Do(ctx)
  3853  	if restClient.ErrorRef == nil {
  3854  		return &resp, nil, err
  3855  	}
  3856  	return &resp, &errors, err
  3857  }
  3858  
  3859  // PatchEmailTemplate
  3860  // Updates, via PATCH, the email template with the given Id.
  3861  //
  3862  //	string emailTemplateId The Id of the email template to update.
  3863  //	EmailTemplateRequest request The request that contains just the new email template information.
  3864  func (c *FusionAuthClient) PatchEmailTemplate(emailTemplateId string, request map[string]interface{}) (*EmailTemplateResponse, *Errors, error) {
  3865  	return c.PatchEmailTemplateWithContext(context.TODO(), emailTemplateId, request)
  3866  }
  3867  
  3868  // PatchEmailTemplateWithContext
  3869  // Updates, via PATCH, the email template with the given Id.
  3870  //
  3871  //	string emailTemplateId The Id of the email template to update.
  3872  //	EmailTemplateRequest request The request that contains just the new email template information.
  3873  func (c *FusionAuthClient) PatchEmailTemplateWithContext(ctx context.Context, emailTemplateId string, request map[string]interface{}) (*EmailTemplateResponse, *Errors, error) {
  3874  	var resp EmailTemplateResponse
  3875  	var errors Errors
  3876  
  3877  	restClient := c.Start(&resp, &errors)
  3878  	err := restClient.WithUri("/api/email/template").
  3879  		WithUriSegment(emailTemplateId).
  3880  		WithJSONBody(request).
  3881  		WithMethod(http.MethodPatch).
  3882  		Do(ctx)
  3883  	if restClient.ErrorRef == nil {
  3884  		return &resp, nil, err
  3885  	}
  3886  	return &resp, &errors, err
  3887  }
  3888  
  3889  // PatchEntityType
  3890  // Updates, via PATCH, the Entity Type with the given Id.
  3891  //
  3892  //	string entityTypeId The Id of the Entity Type to update.
  3893  //	EntityTypeRequest request The request that contains just the new Entity Type information.
  3894  func (c *FusionAuthClient) PatchEntityType(entityTypeId string, request map[string]interface{}) (*EntityTypeResponse, *Errors, error) {
  3895  	return c.PatchEntityTypeWithContext(context.TODO(), entityTypeId, request)
  3896  }
  3897  
  3898  // PatchEntityTypeWithContext
  3899  // Updates, via PATCH, the Entity Type with the given Id.
  3900  //
  3901  //	string entityTypeId The Id of the Entity Type to update.
  3902  //	EntityTypeRequest request The request that contains just the new Entity Type information.
  3903  func (c *FusionAuthClient) PatchEntityTypeWithContext(ctx context.Context, entityTypeId string, request map[string]interface{}) (*EntityTypeResponse, *Errors, error) {
  3904  	var resp EntityTypeResponse
  3905  	var errors Errors
  3906  
  3907  	restClient := c.Start(&resp, &errors)
  3908  	err := restClient.WithUri("/api/entity/type").
  3909  		WithUriSegment(entityTypeId).
  3910  		WithJSONBody(request).
  3911  		WithMethod(http.MethodPatch).
  3912  		Do(ctx)
  3913  	if restClient.ErrorRef == nil {
  3914  		return &resp, nil, err
  3915  	}
  3916  	return &resp, &errors, err
  3917  }
  3918  
  3919  // PatchGroup
  3920  // Updates, via PATCH, the group with the given Id.
  3921  //
  3922  //	string groupId The Id of the group to update.
  3923  //	GroupRequest request The request that contains just the new group information.
  3924  func (c *FusionAuthClient) PatchGroup(groupId string, request map[string]interface{}) (*GroupResponse, *Errors, error) {
  3925  	return c.PatchGroupWithContext(context.TODO(), groupId, request)
  3926  }
  3927  
  3928  // PatchGroupWithContext
  3929  // Updates, via PATCH, the group with the given Id.
  3930  //
  3931  //	string groupId The Id of the group to update.
  3932  //	GroupRequest request The request that contains just the new group information.
  3933  func (c *FusionAuthClient) PatchGroupWithContext(ctx context.Context, groupId string, request map[string]interface{}) (*GroupResponse, *Errors, error) {
  3934  	var resp GroupResponse
  3935  	var errors Errors
  3936  
  3937  	restClient := c.Start(&resp, &errors)
  3938  	err := restClient.WithUri("/api/group").
  3939  		WithUriSegment(groupId).
  3940  		WithJSONBody(request).
  3941  		WithMethod(http.MethodPatch).
  3942  		Do(ctx)
  3943  	if restClient.ErrorRef == nil {
  3944  		return &resp, nil, err
  3945  	}
  3946  	return &resp, &errors, err
  3947  }
  3948  
  3949  // PatchIdentityProvider
  3950  // Updates, via PATCH, the identity provider with the given Id.
  3951  //
  3952  //	string identityProviderId The Id of the identity provider to update.
  3953  //	IdentityProviderRequest request The request object that contains just the updated identity provider information.
  3954  func (c *FusionAuthClient) PatchIdentityProvider(identityProviderId string, request map[string]interface{}) (*IdentityProviderResponse, *Errors, error) {
  3955  	return c.PatchIdentityProviderWithContext(context.TODO(), identityProviderId, request)
  3956  }
  3957  
  3958  // PatchIdentityProviderWithContext
  3959  // Updates, via PATCH, the identity provider with the given Id.
  3960  //
  3961  //	string identityProviderId The Id of the identity provider to update.
  3962  //	IdentityProviderRequest request The request object that contains just the updated identity provider information.
  3963  func (c *FusionAuthClient) PatchIdentityProviderWithContext(ctx context.Context, identityProviderId string, request map[string]interface{}) (*IdentityProviderResponse, *Errors, error) {
  3964  	var resp IdentityProviderResponse
  3965  	var errors Errors
  3966  
  3967  	restClient := c.Start(&resp, &errors)
  3968  	err := restClient.WithUri("/api/identity-provider").
  3969  		WithUriSegment(identityProviderId).
  3970  		WithJSONBody(request).
  3971  		WithMethod(http.MethodPatch).
  3972  		Do(ctx)
  3973  	if restClient.ErrorRef == nil {
  3974  		return &resp, nil, err
  3975  	}
  3976  	return &resp, &errors, err
  3977  }
  3978  
  3979  // PatchIntegrations
  3980  // Updates, via PATCH, the available integrations.
  3981  //
  3982  //	IntegrationRequest request The request that contains just the new integration information.
  3983  func (c *FusionAuthClient) PatchIntegrations(request map[string]interface{}) (*IntegrationResponse, *Errors, error) {
  3984  	return c.PatchIntegrationsWithContext(context.TODO(), request)
  3985  }
  3986  
  3987  // PatchIntegrationsWithContext
  3988  // Updates, via PATCH, the available integrations.
  3989  //
  3990  //	IntegrationRequest request The request that contains just the new integration information.
  3991  func (c *FusionAuthClient) PatchIntegrationsWithContext(ctx context.Context, request map[string]interface{}) (*IntegrationResponse, *Errors, error) {
  3992  	var resp IntegrationResponse
  3993  	var errors Errors
  3994  
  3995  	restClient := c.Start(&resp, &errors)
  3996  	err := restClient.WithUri("/api/integration").
  3997  		WithJSONBody(request).
  3998  		WithMethod(http.MethodPatch).
  3999  		Do(ctx)
  4000  	if restClient.ErrorRef == nil {
  4001  		return &resp, nil, err
  4002  	}
  4003  	return &resp, &errors, err
  4004  }
  4005  
  4006  // PatchLambda
  4007  // Updates, via PATCH, the lambda with the given Id.
  4008  //
  4009  //	string lambdaId The Id of the lambda to update.
  4010  //	LambdaRequest request The request that contains just the new lambda information.
  4011  func (c *FusionAuthClient) PatchLambda(lambdaId string, request map[string]interface{}) (*LambdaResponse, *Errors, error) {
  4012  	return c.PatchLambdaWithContext(context.TODO(), lambdaId, request)
  4013  }
  4014  
  4015  // PatchLambdaWithContext
  4016  // Updates, via PATCH, the lambda with the given Id.
  4017  //
  4018  //	string lambdaId The Id of the lambda to update.
  4019  //	LambdaRequest request The request that contains just the new lambda information.
  4020  func (c *FusionAuthClient) PatchLambdaWithContext(ctx context.Context, lambdaId string, request map[string]interface{}) (*LambdaResponse, *Errors, error) {
  4021  	var resp LambdaResponse
  4022  	var errors Errors
  4023  
  4024  	restClient := c.Start(&resp, &errors)
  4025  	err := restClient.WithUri("/api/lambda").
  4026  		WithUriSegment(lambdaId).
  4027  		WithJSONBody(request).
  4028  		WithMethod(http.MethodPatch).
  4029  		Do(ctx)
  4030  	if restClient.ErrorRef == nil {
  4031  		return &resp, nil, err
  4032  	}
  4033  	return &resp, &errors, err
  4034  }
  4035  
  4036  // PatchMessageTemplate
  4037  // Updates, via PATCH, the message template with the given Id.
  4038  //
  4039  //	string messageTemplateId The Id of the message template to update.
  4040  //	MessageTemplateRequest request The request that contains just the new message template information.
  4041  func (c *FusionAuthClient) PatchMessageTemplate(messageTemplateId string, request map[string]interface{}) (*MessageTemplateResponse, *Errors, error) {
  4042  	return c.PatchMessageTemplateWithContext(context.TODO(), messageTemplateId, request)
  4043  }
  4044  
  4045  // PatchMessageTemplateWithContext
  4046  // Updates, via PATCH, the message template with the given Id.
  4047  //
  4048  //	string messageTemplateId The Id of the message template to update.
  4049  //	MessageTemplateRequest request The request that contains just the new message template information.
  4050  func (c *FusionAuthClient) PatchMessageTemplateWithContext(ctx context.Context, messageTemplateId string, request map[string]interface{}) (*MessageTemplateResponse, *Errors, error) {
  4051  	var resp MessageTemplateResponse
  4052  	var errors Errors
  4053  
  4054  	restClient := c.Start(&resp, &errors)
  4055  	err := restClient.WithUri("/api/message/template").
  4056  		WithUriSegment(messageTemplateId).
  4057  		WithJSONBody(request).
  4058  		WithMethod(http.MethodPatch).
  4059  		Do(ctx)
  4060  	if restClient.ErrorRef == nil {
  4061  		return &resp, nil, err
  4062  	}
  4063  	return &resp, &errors, err
  4064  }
  4065  
  4066  // PatchMessenger
  4067  // Updates, via PATCH, the messenger with the given Id.
  4068  //
  4069  //	string messengerId The Id of the messenger to update.
  4070  //	MessengerRequest request The request that contains just the new messenger information.
  4071  func (c *FusionAuthClient) PatchMessenger(messengerId string, request map[string]interface{}) (*MessengerResponse, *Errors, error) {
  4072  	return c.PatchMessengerWithContext(context.TODO(), messengerId, request)
  4073  }
  4074  
  4075  // PatchMessengerWithContext
  4076  // Updates, via PATCH, the messenger with the given Id.
  4077  //
  4078  //	string messengerId The Id of the messenger to update.
  4079  //	MessengerRequest request The request that contains just the new messenger information.
  4080  func (c *FusionAuthClient) PatchMessengerWithContext(ctx context.Context, messengerId string, request map[string]interface{}) (*MessengerResponse, *Errors, error) {
  4081  	var resp MessengerResponse
  4082  	var errors Errors
  4083  
  4084  	restClient := c.Start(&resp, &errors)
  4085  	err := restClient.WithUri("/api/messenger").
  4086  		WithUriSegment(messengerId).
  4087  		WithJSONBody(request).
  4088  		WithMethod(http.MethodPatch).
  4089  		Do(ctx)
  4090  	if restClient.ErrorRef == nil {
  4091  		return &resp, nil, err
  4092  	}
  4093  	return &resp, &errors, err
  4094  }
  4095  
  4096  // PatchOAuthScope
  4097  // Updates, via PATCH, the custom OAuth scope with the given Id for the application.
  4098  //
  4099  //	string applicationId The Id of the application that the OAuth scope belongs to.
  4100  //	string scopeId The Id of the OAuth scope to update.
  4101  //	ApplicationOAuthScopeRequest request The request that contains just the new OAuth scope information.
  4102  func (c *FusionAuthClient) PatchOAuthScope(applicationId string, scopeId string, request map[string]interface{}) (*ApplicationOAuthScopeResponse, *Errors, error) {
  4103  	return c.PatchOAuthScopeWithContext(context.TODO(), applicationId, scopeId, request)
  4104  }
  4105  
  4106  // PatchOAuthScopeWithContext
  4107  // Updates, via PATCH, the custom OAuth scope with the given Id for the application.
  4108  //
  4109  //	string applicationId The Id of the application that the OAuth scope belongs to.
  4110  //	string scopeId The Id of the OAuth scope to update.
  4111  //	ApplicationOAuthScopeRequest request The request that contains just the new OAuth scope information.
  4112  func (c *FusionAuthClient) PatchOAuthScopeWithContext(ctx context.Context, applicationId string, scopeId string, request map[string]interface{}) (*ApplicationOAuthScopeResponse, *Errors, error) {
  4113  	var resp ApplicationOAuthScopeResponse
  4114  	var errors Errors
  4115  
  4116  	restClient := c.Start(&resp, &errors)
  4117  	err := restClient.WithUri("/api/application").
  4118  		WithUriSegment(applicationId).
  4119  		WithUriSegment("scope").
  4120  		WithUriSegment(scopeId).
  4121  		WithJSONBody(request).
  4122  		WithMethod(http.MethodPatch).
  4123  		Do(ctx)
  4124  	if restClient.ErrorRef == nil {
  4125  		return &resp, nil, err
  4126  	}
  4127  	return &resp, &errors, err
  4128  }
  4129  
  4130  // PatchRegistration
  4131  // Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
  4132  //
  4133  //	string userId The Id of the user whose registration is going to be updated.
  4134  //	RegistrationRequest request The request that contains just the new registration information.
  4135  func (c *FusionAuthClient) PatchRegistration(userId string, request map[string]interface{}) (*RegistrationResponse, *Errors, error) {
  4136  	return c.PatchRegistrationWithContext(context.TODO(), userId, request)
  4137  }
  4138  
  4139  // PatchRegistrationWithContext
  4140  // Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
  4141  //
  4142  //	string userId The Id of the user whose registration is going to be updated.
  4143  //	RegistrationRequest request The request that contains just the new registration information.
  4144  func (c *FusionAuthClient) PatchRegistrationWithContext(ctx context.Context, userId string, request map[string]interface{}) (*RegistrationResponse, *Errors, error) {
  4145  	var resp RegistrationResponse
  4146  	var errors Errors
  4147  
  4148  	restClient := c.Start(&resp, &errors)
  4149  	err := restClient.WithUri("/api/user/registration").
  4150  		WithUriSegment(userId).
  4151  		WithJSONBody(request).
  4152  		WithMethod(http.MethodPatch).
  4153  		Do(ctx)
  4154  	if restClient.ErrorRef == nil {
  4155  		return &resp, nil, err
  4156  	}
  4157  	return &resp, &errors, err
  4158  }
  4159  
  4160  // PatchSystemConfiguration
  4161  // Updates, via PATCH, the system configuration.
  4162  //
  4163  //	SystemConfigurationRequest request The request that contains just the new system configuration information.
  4164  func (c *FusionAuthClient) PatchSystemConfiguration(request map[string]interface{}) (*SystemConfigurationResponse, *Errors, error) {
  4165  	return c.PatchSystemConfigurationWithContext(context.TODO(), request)
  4166  }
  4167  
  4168  // PatchSystemConfigurationWithContext
  4169  // Updates, via PATCH, the system configuration.
  4170  //
  4171  //	SystemConfigurationRequest request The request that contains just the new system configuration information.
  4172  func (c *FusionAuthClient) PatchSystemConfigurationWithContext(ctx context.Context, request map[string]interface{}) (*SystemConfigurationResponse, *Errors, error) {
  4173  	var resp SystemConfigurationResponse
  4174  	var errors Errors
  4175  
  4176  	restClient := c.Start(&resp, &errors)
  4177  	err := restClient.WithUri("/api/system-configuration").
  4178  		WithJSONBody(request).
  4179  		WithMethod(http.MethodPatch).
  4180  		Do(ctx)
  4181  	if restClient.ErrorRef == nil {
  4182  		return &resp, nil, err
  4183  	}
  4184  	return &resp, &errors, err
  4185  }
  4186  
  4187  // PatchTenant
  4188  // Updates, via PATCH, the tenant with the given Id.
  4189  //
  4190  //	string tenantId The Id of the tenant to update.
  4191  //	TenantRequest request The request that contains just the new tenant information.
  4192  func (c *FusionAuthClient) PatchTenant(tenantId string, request map[string]interface{}) (*TenantResponse, *Errors, error) {
  4193  	return c.PatchTenantWithContext(context.TODO(), tenantId, request)
  4194  }
  4195  
  4196  // PatchTenantWithContext
  4197  // Updates, via PATCH, the tenant with the given Id.
  4198  //
  4199  //	string tenantId The Id of the tenant to update.
  4200  //	TenantRequest request The request that contains just the new tenant information.
  4201  func (c *FusionAuthClient) PatchTenantWithContext(ctx context.Context, tenantId string, request map[string]interface{}) (*TenantResponse, *Errors, error) {
  4202  	var resp TenantResponse
  4203  	var errors Errors
  4204  
  4205  	restClient := c.Start(&resp, &errors)
  4206  	err := restClient.WithUri("/api/tenant").
  4207  		WithUriSegment(tenantId).
  4208  		WithJSONBody(request).
  4209  		WithMethod(http.MethodPatch).
  4210  		Do(ctx)
  4211  	if restClient.ErrorRef == nil {
  4212  		return &resp, nil, err
  4213  	}
  4214  	return &resp, &errors, err
  4215  }
  4216  
  4217  // PatchTheme
  4218  // Updates, via PATCH, the theme with the given Id.
  4219  //
  4220  //	string themeId The Id of the theme to update.
  4221  //	ThemeRequest request The request that contains just the new theme information.
  4222  func (c *FusionAuthClient) PatchTheme(themeId string, request map[string]interface{}) (*ThemeResponse, *Errors, error) {
  4223  	return c.PatchThemeWithContext(context.TODO(), themeId, request)
  4224  }
  4225  
  4226  // PatchThemeWithContext
  4227  // Updates, via PATCH, the theme with the given Id.
  4228  //
  4229  //	string themeId The Id of the theme to update.
  4230  //	ThemeRequest request The request that contains just the new theme information.
  4231  func (c *FusionAuthClient) PatchThemeWithContext(ctx context.Context, themeId string, request map[string]interface{}) (*ThemeResponse, *Errors, error) {
  4232  	var resp ThemeResponse
  4233  	var errors Errors
  4234  
  4235  	restClient := c.Start(&resp, &errors)
  4236  	err := restClient.WithUri("/api/theme").
  4237  		WithUriSegment(themeId).
  4238  		WithJSONBody(request).
  4239  		WithMethod(http.MethodPatch).
  4240  		Do(ctx)
  4241  	if restClient.ErrorRef == nil {
  4242  		return &resp, nil, err
  4243  	}
  4244  	return &resp, &errors, err
  4245  }
  4246  
  4247  // PatchUser
  4248  // Updates, via PATCH, the user with the given Id.
  4249  //
  4250  //	string userId The Id of the user to update.
  4251  //	UserRequest request The request that contains just the new user information.
  4252  func (c *FusionAuthClient) PatchUser(userId string, request map[string]interface{}) (*UserResponse, *Errors, error) {
  4253  	return c.PatchUserWithContext(context.TODO(), userId, request)
  4254  }
  4255  
  4256  // PatchUserWithContext
  4257  // Updates, via PATCH, the user with the given Id.
  4258  //
  4259  //	string userId The Id of the user to update.
  4260  //	UserRequest request The request that contains just the new user information.
  4261  func (c *FusionAuthClient) PatchUserWithContext(ctx context.Context, userId string, request map[string]interface{}) (*UserResponse, *Errors, error) {
  4262  	var resp UserResponse
  4263  	var errors Errors
  4264  
  4265  	restClient := c.Start(&resp, &errors)
  4266  	err := restClient.WithUri("/api/user").
  4267  		WithUriSegment(userId).
  4268  		WithJSONBody(request).
  4269  		WithMethod(http.MethodPatch).
  4270  		Do(ctx)
  4271  	if restClient.ErrorRef == nil {
  4272  		return &resp, nil, err
  4273  	}
  4274  	return &resp, &errors, err
  4275  }
  4276  
  4277  // PatchUserAction
  4278  // Updates, via PATCH, the user action with the given Id.
  4279  //
  4280  //	string userActionId The Id of the user action to update.
  4281  //	UserActionRequest request The request that contains just the new user action information.
  4282  func (c *FusionAuthClient) PatchUserAction(userActionId string, request map[string]interface{}) (*UserActionResponse, *Errors, error) {
  4283  	return c.PatchUserActionWithContext(context.TODO(), userActionId, request)
  4284  }
  4285  
  4286  // PatchUserActionWithContext
  4287  // Updates, via PATCH, the user action with the given Id.
  4288  //
  4289  //	string userActionId The Id of the user action to update.
  4290  //	UserActionRequest request The request that contains just the new user action information.
  4291  func (c *FusionAuthClient) PatchUserActionWithContext(ctx context.Context, userActionId string, request map[string]interface{}) (*UserActionResponse, *Errors, error) {
  4292  	var resp UserActionResponse
  4293  	var errors Errors
  4294  
  4295  	restClient := c.Start(&resp, &errors)
  4296  	err := restClient.WithUri("/api/user-action").
  4297  		WithUriSegment(userActionId).
  4298  		WithJSONBody(request).
  4299  		WithMethod(http.MethodPatch).
  4300  		Do(ctx)
  4301  	if restClient.ErrorRef == nil {
  4302  		return &resp, nil, err
  4303  	}
  4304  	return &resp, &errors, err
  4305  }
  4306  
  4307  // PatchUserActionReason
  4308  // Updates, via PATCH, the user action reason with the given Id.
  4309  //
  4310  //	string userActionReasonId The Id of the user action reason to update.
  4311  //	UserActionReasonRequest request The request that contains just the new user action reason information.
  4312  func (c *FusionAuthClient) PatchUserActionReason(userActionReasonId string, request map[string]interface{}) (*UserActionReasonResponse, *Errors, error) {
  4313  	return c.PatchUserActionReasonWithContext(context.TODO(), userActionReasonId, request)
  4314  }
  4315  
  4316  // PatchUserActionReasonWithContext
  4317  // Updates, via PATCH, the user action reason with the given Id.
  4318  //
  4319  //	string userActionReasonId The Id of the user action reason to update.
  4320  //	UserActionReasonRequest request The request that contains just the new user action reason information.
  4321  func (c *FusionAuthClient) PatchUserActionReasonWithContext(ctx context.Context, userActionReasonId string, request map[string]interface{}) (*UserActionReasonResponse, *Errors, error) {
  4322  	var resp UserActionReasonResponse
  4323  	var errors Errors
  4324  
  4325  	restClient := c.Start(&resp, &errors)
  4326  	err := restClient.WithUri("/api/user-action-reason").
  4327  		WithUriSegment(userActionReasonId).
  4328  		WithJSONBody(request).
  4329  		WithMethod(http.MethodPatch).
  4330  		Do(ctx)
  4331  	if restClient.ErrorRef == nil {
  4332  		return &resp, nil, err
  4333  	}
  4334  	return &resp, &errors, err
  4335  }
  4336  
  4337  // PatchUserConsent
  4338  // Updates, via PATCH, a single User consent by Id.
  4339  //
  4340  //	string userConsentId The User Consent Id
  4341  //	UserConsentRequest request The request that contains just the new user consent information.
  4342  func (c *FusionAuthClient) PatchUserConsent(userConsentId string, request map[string]interface{}) (*UserConsentResponse, *Errors, error) {
  4343  	return c.PatchUserConsentWithContext(context.TODO(), userConsentId, request)
  4344  }
  4345  
  4346  // PatchUserConsentWithContext
  4347  // Updates, via PATCH, a single User consent by Id.
  4348  //
  4349  //	string userConsentId The User Consent Id
  4350  //	UserConsentRequest request The request that contains just the new user consent information.
  4351  func (c *FusionAuthClient) PatchUserConsentWithContext(ctx context.Context, userConsentId string, request map[string]interface{}) (*UserConsentResponse, *Errors, error) {
  4352  	var resp UserConsentResponse
  4353  	var errors Errors
  4354  
  4355  	restClient := c.Start(&resp, &errors)
  4356  	err := restClient.WithUri("/api/user/consent").
  4357  		WithUriSegment(userConsentId).
  4358  		WithJSONBody(request).
  4359  		WithMethod(http.MethodPatch).
  4360  		Do(ctx)
  4361  	if restClient.ErrorRef == nil {
  4362  		return &resp, nil, err
  4363  	}
  4364  	return &resp, &errors, err
  4365  }
  4366  
  4367  // ReactivateApplication
  4368  // Reactivates the application with the given Id.
  4369  //
  4370  //	string applicationId The Id of the application to reactivate.
  4371  func (c *FusionAuthClient) ReactivateApplication(applicationId string) (*ApplicationResponse, *Errors, error) {
  4372  	return c.ReactivateApplicationWithContext(context.TODO(), applicationId)
  4373  }
  4374  
  4375  // ReactivateApplicationWithContext
  4376  // Reactivates the application with the given Id.
  4377  //
  4378  //	string applicationId The Id of the application to reactivate.
  4379  func (c *FusionAuthClient) ReactivateApplicationWithContext(ctx context.Context, applicationId string) (*ApplicationResponse, *Errors, error) {
  4380  	var resp ApplicationResponse
  4381  	var errors Errors
  4382  
  4383  	restClient := c.Start(&resp, &errors)
  4384  	err := restClient.WithUri("/api/application").
  4385  		WithUriSegment(applicationId).
  4386  		WithParameter("reactivate", strconv.FormatBool(true)).
  4387  		WithMethod(http.MethodPut).
  4388  		Do(ctx)
  4389  	if restClient.ErrorRef == nil {
  4390  		return &resp, nil, err
  4391  	}
  4392  	return &resp, &errors, err
  4393  }
  4394  
  4395  // ReactivateUser
  4396  // Reactivates the user with the given Id.
  4397  //
  4398  //	string userId The Id of the user to reactivate.
  4399  func (c *FusionAuthClient) ReactivateUser(userId string) (*UserResponse, *Errors, error) {
  4400  	return c.ReactivateUserWithContext(context.TODO(), userId)
  4401  }
  4402  
  4403  // ReactivateUserWithContext
  4404  // Reactivates the user with the given Id.
  4405  //
  4406  //	string userId The Id of the user to reactivate.
  4407  func (c *FusionAuthClient) ReactivateUserWithContext(ctx context.Context, userId string) (*UserResponse, *Errors, error) {
  4408  	var resp UserResponse
  4409  	var errors Errors
  4410  
  4411  	restClient := c.Start(&resp, &errors)
  4412  	err := restClient.WithUri("/api/user").
  4413  		WithUriSegment(userId).
  4414  		WithParameter("reactivate", strconv.FormatBool(true)).
  4415  		WithMethod(http.MethodPut).
  4416  		Do(ctx)
  4417  	if restClient.ErrorRef == nil {
  4418  		return &resp, nil, err
  4419  	}
  4420  	return &resp, &errors, err
  4421  }
  4422  
  4423  // ReactivateUserAction
  4424  // Reactivates the user action with the given Id.
  4425  //
  4426  //	string userActionId The Id of the user action to reactivate.
  4427  func (c *FusionAuthClient) ReactivateUserAction(userActionId string) (*UserActionResponse, *Errors, error) {
  4428  	return c.ReactivateUserActionWithContext(context.TODO(), userActionId)
  4429  }
  4430  
  4431  // ReactivateUserActionWithContext
  4432  // Reactivates the user action with the given Id.
  4433  //
  4434  //	string userActionId The Id of the user action to reactivate.
  4435  func (c *FusionAuthClient) ReactivateUserActionWithContext(ctx context.Context, userActionId string) (*UserActionResponse, *Errors, error) {
  4436  	var resp UserActionResponse
  4437  	var errors Errors
  4438  
  4439  	restClient := c.Start(&resp, &errors)
  4440  	err := restClient.WithUri("/api/user-action").
  4441  		WithUriSegment(userActionId).
  4442  		WithParameter("reactivate", strconv.FormatBool(true)).
  4443  		WithMethod(http.MethodPut).
  4444  		Do(ctx)
  4445  	if restClient.ErrorRef == nil {
  4446  		return &resp, nil, err
  4447  	}
  4448  	return &resp, &errors, err
  4449  }
  4450  
  4451  // ReconcileJWT
  4452  // Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
  4453  //
  4454  //	IdentityProviderLoginRequest request The reconcile request that contains the data to reconcile the User.
  4455  func (c *FusionAuthClient) ReconcileJWT(request IdentityProviderLoginRequest) (*LoginResponse, *Errors, error) {
  4456  	return c.ReconcileJWTWithContext(context.TODO(), request)
  4457  }
  4458  
  4459  // ReconcileJWTWithContext
  4460  // Reconcile a User to FusionAuth using JWT issued from another Identity Provider.
  4461  //
  4462  //	IdentityProviderLoginRequest request The reconcile request that contains the data to reconcile the User.
  4463  func (c *FusionAuthClient) ReconcileJWTWithContext(ctx context.Context, request IdentityProviderLoginRequest) (*LoginResponse, *Errors, error) {
  4464  	var resp LoginResponse
  4465  	var errors Errors
  4466  
  4467  	restClient := c.StartAnonymous(&resp, &errors)
  4468  	err := restClient.WithUri("/api/jwt/reconcile").
  4469  		WithJSONBody(request).
  4470  		WithMethod(http.MethodPost).
  4471  		Do(ctx)
  4472  	if restClient.ErrorRef == nil {
  4473  		return &resp, nil, err
  4474  	}
  4475  	return &resp, &errors, err
  4476  }
  4477  
  4478  // RefreshEntitySearchIndex
  4479  // Request a refresh of the Entity search index. This API is not generally necessary and the search index will become consistent in a
  4480  // reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
  4481  // if you are using the Search API or Delete Tenant API immediately following a Entity Create etc, you may wish to request a refresh to
  4482  //
  4483  //	ensure the index immediately current before making a query request to the search index.
  4484  func (c *FusionAuthClient) RefreshEntitySearchIndex() (*BaseHTTPResponse, error) {
  4485  	return c.RefreshEntitySearchIndexWithContext(context.TODO())
  4486  }
  4487  
  4488  // RefreshEntitySearchIndexWithContext
  4489  // Request a refresh of the Entity search index. This API is not generally necessary and the search index will become consistent in a
  4490  // reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
  4491  // if you are using the Search API or Delete Tenant API immediately following a Entity Create etc, you may wish to request a refresh to
  4492  //
  4493  //	ensure the index immediately current before making a query request to the search index.
  4494  func (c *FusionAuthClient) RefreshEntitySearchIndexWithContext(ctx context.Context) (*BaseHTTPResponse, error) {
  4495  	var resp BaseHTTPResponse
  4496  
  4497  	err := c.Start(&resp, nil).
  4498  		WithUri("/api/entity/search").
  4499  		WithMethod(http.MethodPut).
  4500  		Do(ctx)
  4501  	return &resp, err
  4502  }
  4503  
  4504  // RefreshUserSearchIndex
  4505  // Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a
  4506  // reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
  4507  // if you are using the Search API or Delete Tenant API immediately following a User Create etc, you may wish to request a refresh to
  4508  //
  4509  //	ensure the index immediately current before making a query request to the search index.
  4510  func (c *FusionAuthClient) RefreshUserSearchIndex() (*BaseHTTPResponse, error) {
  4511  	return c.RefreshUserSearchIndexWithContext(context.TODO())
  4512  }
  4513  
  4514  // RefreshUserSearchIndexWithContext
  4515  // Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a
  4516  // reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
  4517  // if you are using the Search API or Delete Tenant API immediately following a User Create etc, you may wish to request a refresh to
  4518  //
  4519  //	ensure the index immediately current before making a query request to the search index.
  4520  func (c *FusionAuthClient) RefreshUserSearchIndexWithContext(ctx context.Context) (*BaseHTTPResponse, error) {
  4521  	var resp BaseHTTPResponse
  4522  
  4523  	err := c.Start(&resp, nil).
  4524  		WithUri("/api/user/search").
  4525  		WithMethod(http.MethodPut).
  4526  		Do(ctx)
  4527  	return &resp, err
  4528  }
  4529  
  4530  // RegenerateReactorKeys
  4531  // Regenerates any keys that are used by the FusionAuth Reactor.
  4532  func (c *FusionAuthClient) RegenerateReactorKeys() (*BaseHTTPResponse, error) {
  4533  	return c.RegenerateReactorKeysWithContext(context.TODO())
  4534  }
  4535  
  4536  // RegenerateReactorKeysWithContext
  4537  // Regenerates any keys that are used by the FusionAuth Reactor.
  4538  func (c *FusionAuthClient) RegenerateReactorKeysWithContext(ctx context.Context) (*BaseHTTPResponse, error) {
  4539  	var resp BaseHTTPResponse
  4540  
  4541  	err := c.Start(&resp, nil).
  4542  		WithUri("/api/reactor").
  4543  		WithMethod(http.MethodPut).
  4544  		Do(ctx)
  4545  	return &resp, err
  4546  }
  4547  
  4548  // Register
  4549  // Registers a user for an application. If you provide the User and the UserRegistration object on this request, it
  4550  // will create the user as well as register them for the application. This is called a Full Registration. However, if
  4551  // you only provide the UserRegistration object, then the user must already exist and they will be registered for the
  4552  // application. The user Id can also be provided and it will either be used to look up an existing user or it will be
  4553  // used for the newly created User.
  4554  //
  4555  //	string userId (Optional) The Id of the user being registered for the application and optionally created.
  4556  //	RegistrationRequest request The request that optionally contains the User and must contain the UserRegistration.
  4557  func (c *FusionAuthClient) Register(userId string, request RegistrationRequest) (*RegistrationResponse, *Errors, error) {
  4558  	return c.RegisterWithContext(context.TODO(), userId, request)
  4559  }
  4560  
  4561  // RegisterWithContext
  4562  // Registers a user for an application. If you provide the User and the UserRegistration object on this request, it
  4563  // will create the user as well as register them for the application. This is called a Full Registration. However, if
  4564  // you only provide the UserRegistration object, then the user must already exist and they will be registered for the
  4565  // application. The user Id can also be provided and it will either be used to look up an existing user or it will be
  4566  // used for the newly created User.
  4567  //
  4568  //	string userId (Optional) The Id of the user being registered for the application and optionally created.
  4569  //	RegistrationRequest request The request that optionally contains the User and must contain the UserRegistration.
  4570  func (c *FusionAuthClient) RegisterWithContext(ctx context.Context, userId string, request RegistrationRequest) (*RegistrationResponse, *Errors, error) {
  4571  	var resp RegistrationResponse
  4572  	var errors Errors
  4573  
  4574  	restClient := c.Start(&resp, &errors)
  4575  	err := restClient.WithUri("/api/user/registration").
  4576  		WithUriSegment(userId).
  4577  		WithJSONBody(request).
  4578  		WithMethod(http.MethodPost).
  4579  		Do(ctx)
  4580  	if restClient.ErrorRef == nil {
  4581  		return &resp, nil, err
  4582  	}
  4583  	return &resp, &errors, err
  4584  }
  4585  
  4586  // Reindex
  4587  // Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will
  4588  // increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless
  4589  // instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.
  4590  //
  4591  // You have been warned.
  4592  //
  4593  //	ReindexRequest request The request that contains the index name.
  4594  func (c *FusionAuthClient) Reindex(request ReindexRequest) (*BaseHTTPResponse, *Errors, error) {
  4595  	return c.ReindexWithContext(context.TODO(), request)
  4596  }
  4597  
  4598  // ReindexWithContext
  4599  // Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will
  4600  // increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless
  4601  // instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.
  4602  //
  4603  // You have been warned.
  4604  //
  4605  //	ReindexRequest request The request that contains the index name.
  4606  func (c *FusionAuthClient) ReindexWithContext(ctx context.Context, request ReindexRequest) (*BaseHTTPResponse, *Errors, error) {
  4607  	var resp BaseHTTPResponse
  4608  	var errors Errors
  4609  
  4610  	restClient := c.Start(&resp, &errors)
  4611  	err := restClient.WithUri("/api/system/reindex").
  4612  		WithJSONBody(request).
  4613  		WithMethod(http.MethodPost).
  4614  		Do(ctx)
  4615  	if restClient.ErrorRef == nil {
  4616  		return &resp, nil, err
  4617  	}
  4618  	return &resp, &errors, err
  4619  }
  4620  
  4621  // RemoveUserFromFamily
  4622  // Removes a user from the family with the given id.
  4623  //
  4624  //	string familyId The Id of the family to remove the user from.
  4625  //	string userId The Id of the user to remove from the family.
  4626  func (c *FusionAuthClient) RemoveUserFromFamily(familyId string, userId string) (*BaseHTTPResponse, *Errors, error) {
  4627  	return c.RemoveUserFromFamilyWithContext(context.TODO(), familyId, userId)
  4628  }
  4629  
  4630  // RemoveUserFromFamilyWithContext
  4631  // Removes a user from the family with the given id.
  4632  //
  4633  //	string familyId The Id of the family to remove the user from.
  4634  //	string userId The Id of the user to remove from the family.
  4635  func (c *FusionAuthClient) RemoveUserFromFamilyWithContext(ctx context.Context, familyId string, userId string) (*BaseHTTPResponse, *Errors, error) {
  4636  	var resp BaseHTTPResponse
  4637  	var errors Errors
  4638  
  4639  	restClient := c.Start(&resp, &errors)
  4640  	err := restClient.WithUri("/api/user/family").
  4641  		WithUriSegment(familyId).
  4642  		WithUriSegment(userId).
  4643  		WithMethod(http.MethodDelete).
  4644  		Do(ctx)
  4645  	if restClient.ErrorRef == nil {
  4646  		return &resp, nil, err
  4647  	}
  4648  	return &resp, &errors, err
  4649  }
  4650  
  4651  // ResendEmailVerification
  4652  // Re-sends the verification email to the user.
  4653  //
  4654  //	string email The email address of the user that needs a new verification email.
  4655  func (c *FusionAuthClient) ResendEmailVerification(email string) (*VerifyEmailResponse, *Errors, error) {
  4656  	return c.ResendEmailVerificationWithContext(context.TODO(), email)
  4657  }
  4658  
  4659  // ResendEmailVerificationWithContext
  4660  // Re-sends the verification email to the user.
  4661  //
  4662  //	string email The email address of the user that needs a new verification email.
  4663  func (c *FusionAuthClient) ResendEmailVerificationWithContext(ctx context.Context, email string) (*VerifyEmailResponse, *Errors, error) {
  4664  	var resp VerifyEmailResponse
  4665  	var errors Errors
  4666  
  4667  	restClient := c.Start(&resp, &errors)
  4668  	err := restClient.WithUri("/api/user/verify-email").
  4669  		WithParameter("email", email).
  4670  		WithMethod(http.MethodPut).
  4671  		Do(ctx)
  4672  	if restClient.ErrorRef == nil {
  4673  		return &resp, nil, err
  4674  	}
  4675  	return &resp, &errors, err
  4676  }
  4677  
  4678  // ResendEmailVerificationWithApplicationTemplate
  4679  // Re-sends the verification email to the user. If the Application has configured a specific email template this will be used
  4680  // instead of the tenant configuration.
  4681  //
  4682  //	string applicationId The unique Application Id to used to resolve an application specific email template.
  4683  //	string email The email address of the user that needs a new verification email.
  4684  func (c *FusionAuthClient) ResendEmailVerificationWithApplicationTemplate(applicationId string, email string) (*VerifyEmailResponse, *Errors, error) {
  4685  	return c.ResendEmailVerificationWithApplicationTemplateWithContext(context.TODO(), applicationId, email)
  4686  }
  4687  
  4688  // ResendEmailVerificationWithApplicationTemplateWithContext
  4689  // Re-sends the verification email to the user. If the Application has configured a specific email template this will be used
  4690  // instead of the tenant configuration.
  4691  //
  4692  //	string applicationId The unique Application Id to used to resolve an application specific email template.
  4693  //	string email The email address of the user that needs a new verification email.
  4694  func (c *FusionAuthClient) ResendEmailVerificationWithApplicationTemplateWithContext(ctx context.Context, applicationId string, email string) (*VerifyEmailResponse, *Errors, error) {
  4695  	var resp VerifyEmailResponse
  4696  	var errors Errors
  4697  
  4698  	restClient := c.Start(&resp, &errors)
  4699  	err := restClient.WithUri("/api/user/verify-email").
  4700  		WithParameter("applicationId", applicationId).
  4701  		WithParameter("email", email).
  4702  		WithMethod(http.MethodPut).
  4703  		Do(ctx)
  4704  	if restClient.ErrorRef == nil {
  4705  		return &resp, nil, err
  4706  	}
  4707  	return &resp, &errors, err
  4708  }
  4709  
  4710  // ResendRegistrationVerification
  4711  // Re-sends the application registration verification email to the user.
  4712  //
  4713  //	string email The email address of the user that needs a new verification email.
  4714  //	string applicationId The Id of the application to be verified.
  4715  func (c *FusionAuthClient) ResendRegistrationVerification(email string, applicationId string) (*VerifyRegistrationResponse, *Errors, error) {
  4716  	return c.ResendRegistrationVerificationWithContext(context.TODO(), email, applicationId)
  4717  }
  4718  
  4719  // ResendRegistrationVerificationWithContext
  4720  // Re-sends the application registration verification email to the user.
  4721  //
  4722  //	string email The email address of the user that needs a new verification email.
  4723  //	string applicationId The Id of the application to be verified.
  4724  func (c *FusionAuthClient) ResendRegistrationVerificationWithContext(ctx context.Context, email string, applicationId string) (*VerifyRegistrationResponse, *Errors, error) {
  4725  	var resp VerifyRegistrationResponse
  4726  	var errors Errors
  4727  
  4728  	restClient := c.Start(&resp, &errors)
  4729  	err := restClient.WithUri("/api/user/verify-registration").
  4730  		WithParameter("email", email).
  4731  		WithParameter("applicationId", applicationId).
  4732  		WithMethod(http.MethodPut).
  4733  		Do(ctx)
  4734  	if restClient.ErrorRef == nil {
  4735  		return &resp, nil, err
  4736  	}
  4737  	return &resp, &errors, err
  4738  }
  4739  
  4740  // RetrieveAPIKey
  4741  // Retrieves an authentication API key for the given id
  4742  //
  4743  //	string keyId The Id of the API key to retrieve.
  4744  func (c *FusionAuthClient) RetrieveAPIKey(keyId string) (*APIKeyResponse, *Errors, error) {
  4745  	return c.RetrieveAPIKeyWithContext(context.TODO(), keyId)
  4746  }
  4747  
  4748  // RetrieveAPIKeyWithContext
  4749  // Retrieves an authentication API key for the given id
  4750  //
  4751  //	string keyId The Id of the API key to retrieve.
  4752  func (c *FusionAuthClient) RetrieveAPIKeyWithContext(ctx context.Context, keyId string) (*APIKeyResponse, *Errors, error) {
  4753  	var resp APIKeyResponse
  4754  	var errors Errors
  4755  
  4756  	restClient := c.Start(&resp, &errors)
  4757  	err := restClient.WithUri("/api/api-key").
  4758  		WithUriSegment(keyId).
  4759  		WithMethod(http.MethodGet).
  4760  		Do(ctx)
  4761  	if restClient.ErrorRef == nil {
  4762  		return &resp, nil, err
  4763  	}
  4764  	return &resp, &errors, err
  4765  }
  4766  
  4767  // RetrieveAction
  4768  // Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
  4769  //
  4770  //	string actionId The Id of the action to retrieve.
  4771  func (c *FusionAuthClient) RetrieveAction(actionId string) (*ActionResponse, *Errors, error) {
  4772  	return c.RetrieveActionWithContext(context.TODO(), actionId)
  4773  }
  4774  
  4775  // RetrieveActionWithContext
  4776  // Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id.
  4777  //
  4778  //	string actionId The Id of the action to retrieve.
  4779  func (c *FusionAuthClient) RetrieveActionWithContext(ctx context.Context, actionId string) (*ActionResponse, *Errors, error) {
  4780  	var resp ActionResponse
  4781  	var errors Errors
  4782  
  4783  	restClient := c.Start(&resp, &errors)
  4784  	err := restClient.WithUri("/api/user/action").
  4785  		WithUriSegment(actionId).
  4786  		WithMethod(http.MethodGet).
  4787  		Do(ctx)
  4788  	if restClient.ErrorRef == nil {
  4789  		return &resp, nil, err
  4790  	}
  4791  	return &resp, &errors, err
  4792  }
  4793  
  4794  // RetrieveActions
  4795  // Retrieves all the actions for the user with the given Id. This will return all time based actions that are active,
  4796  // and inactive as well as non-time based actions.
  4797  //
  4798  //	string userId The Id of the user to fetch the actions for.
  4799  func (c *FusionAuthClient) RetrieveActions(userId string) (*ActionResponse, *Errors, error) {
  4800  	return c.RetrieveActionsWithContext(context.TODO(), userId)
  4801  }
  4802  
  4803  // RetrieveActionsWithContext
  4804  // Retrieves all the actions for the user with the given Id. This will return all time based actions that are active,
  4805  // and inactive as well as non-time based actions.
  4806  //
  4807  //	string userId The Id of the user to fetch the actions for.
  4808  func (c *FusionAuthClient) RetrieveActionsWithContext(ctx context.Context, userId string) (*ActionResponse, *Errors, error) {
  4809  	var resp ActionResponse
  4810  	var errors Errors
  4811  
  4812  	restClient := c.Start(&resp, &errors)
  4813  	err := restClient.WithUri("/api/user/action").
  4814  		WithParameter("userId", userId).
  4815  		WithMethod(http.MethodGet).
  4816  		Do(ctx)
  4817  	if restClient.ErrorRef == nil {
  4818  		return &resp, nil, err
  4819  	}
  4820  	return &resp, &errors, err
  4821  }
  4822  
  4823  // RetrieveActionsPreventingLogin
  4824  // Retrieves all the actions for the user with the given Id that are currently preventing the User from logging in.
  4825  //
  4826  //	string userId The Id of the user to fetch the actions for.
  4827  func (c *FusionAuthClient) RetrieveActionsPreventingLogin(userId string) (*ActionResponse, *Errors, error) {
  4828  	return c.RetrieveActionsPreventingLoginWithContext(context.TODO(), userId)
  4829  }
  4830  
  4831  // RetrieveActionsPreventingLoginWithContext
  4832  // Retrieves all the actions for the user with the given Id that are currently preventing the User from logging in.
  4833  //
  4834  //	string userId The Id of the user to fetch the actions for.
  4835  func (c *FusionAuthClient) RetrieveActionsPreventingLoginWithContext(ctx context.Context, userId string) (*ActionResponse, *Errors, error) {
  4836  	var resp ActionResponse
  4837  	var errors Errors
  4838  
  4839  	restClient := c.Start(&resp, &errors)
  4840  	err := restClient.WithUri("/api/user/action").
  4841  		WithParameter("userId", userId).
  4842  		WithParameter("preventingLogin", strconv.FormatBool(true)).
  4843  		WithMethod(http.MethodGet).
  4844  		Do(ctx)
  4845  	if restClient.ErrorRef == nil {
  4846  		return &resp, nil, err
  4847  	}
  4848  	return &resp, &errors, err
  4849  }
  4850  
  4851  // RetrieveActiveActions
  4852  // Retrieves all the actions for the user with the given Id that are currently active.
  4853  // An active action means one that is time based and has not been canceled, and has not ended.
  4854  //
  4855  //	string userId The Id of the user to fetch the actions for.
  4856  func (c *FusionAuthClient) RetrieveActiveActions(userId string) (*ActionResponse, *Errors, error) {
  4857  	return c.RetrieveActiveActionsWithContext(context.TODO(), userId)
  4858  }
  4859  
  4860  // RetrieveActiveActionsWithContext
  4861  // Retrieves all the actions for the user with the given Id that are currently active.
  4862  // An active action means one that is time based and has not been canceled, and has not ended.
  4863  //
  4864  //	string userId The Id of the user to fetch the actions for.
  4865  func (c *FusionAuthClient) RetrieveActiveActionsWithContext(ctx context.Context, userId string) (*ActionResponse, *Errors, error) {
  4866  	var resp ActionResponse
  4867  	var errors Errors
  4868  
  4869  	restClient := c.Start(&resp, &errors)
  4870  	err := restClient.WithUri("/api/user/action").
  4871  		WithParameter("userId", userId).
  4872  		WithParameter("active", strconv.FormatBool(true)).
  4873  		WithMethod(http.MethodGet).
  4874  		Do(ctx)
  4875  	if restClient.ErrorRef == nil {
  4876  		return &resp, nil, err
  4877  	}
  4878  	return &resp, &errors, err
  4879  }
  4880  
  4881  // RetrieveApplication
  4882  // Retrieves the application for the given Id or all the applications if the Id is null.
  4883  //
  4884  //	string applicationId (Optional) The application id.
  4885  func (c *FusionAuthClient) RetrieveApplication(applicationId string) (*ApplicationResponse, error) {
  4886  	return c.RetrieveApplicationWithContext(context.TODO(), applicationId)
  4887  }
  4888  
  4889  // RetrieveApplicationWithContext
  4890  // Retrieves the application for the given Id or all the applications if the Id is null.
  4891  //
  4892  //	string applicationId (Optional) The application id.
  4893  func (c *FusionAuthClient) RetrieveApplicationWithContext(ctx context.Context, applicationId string) (*ApplicationResponse, error) {
  4894  	var resp ApplicationResponse
  4895  
  4896  	err := c.Start(&resp, nil).
  4897  		WithUri("/api/application").
  4898  		WithUriSegment(applicationId).
  4899  		WithMethod(http.MethodGet).
  4900  		Do(ctx)
  4901  	return &resp, err
  4902  }
  4903  
  4904  // RetrieveApplications
  4905  // Retrieves all the applications.
  4906  func (c *FusionAuthClient) RetrieveApplications() (*ApplicationResponse, error) {
  4907  	return c.RetrieveApplicationsWithContext(context.TODO())
  4908  }
  4909  
  4910  // RetrieveApplicationsWithContext
  4911  // Retrieves all the applications.
  4912  func (c *FusionAuthClient) RetrieveApplicationsWithContext(ctx context.Context) (*ApplicationResponse, error) {
  4913  	var resp ApplicationResponse
  4914  
  4915  	err := c.Start(&resp, nil).
  4916  		WithUri("/api/application").
  4917  		WithMethod(http.MethodGet).
  4918  		Do(ctx)
  4919  	return &resp, err
  4920  }
  4921  
  4922  // RetrieveAuditLog
  4923  // Retrieves a single audit log for the given Id.
  4924  //
  4925  //	int auditLogId The Id of the audit log to retrieve.
  4926  func (c *FusionAuthClient) RetrieveAuditLog(auditLogId int) (*AuditLogResponse, *Errors, error) {
  4927  	return c.RetrieveAuditLogWithContext(context.TODO(), auditLogId)
  4928  }
  4929  
  4930  // RetrieveAuditLogWithContext
  4931  // Retrieves a single audit log for the given Id.
  4932  //
  4933  //	int auditLogId The Id of the audit log to retrieve.
  4934  func (c *FusionAuthClient) RetrieveAuditLogWithContext(ctx context.Context, auditLogId int) (*AuditLogResponse, *Errors, error) {
  4935  	var resp AuditLogResponse
  4936  	var errors Errors
  4937  
  4938  	restClient := c.Start(&resp, &errors)
  4939  	err := restClient.WithUri("/api/system/audit-log").
  4940  		WithUriSegment(strconv.Itoa(auditLogId)).
  4941  		WithMethod(http.MethodGet).
  4942  		Do(ctx)
  4943  	if restClient.ErrorRef == nil {
  4944  		return &resp, nil, err
  4945  	}
  4946  	return &resp, &errors, err
  4947  }
  4948  
  4949  // RetrieveConnector
  4950  // Retrieves the connector with the given Id.
  4951  //
  4952  //	string connectorId The Id of the connector.
  4953  func (c *FusionAuthClient) RetrieveConnector(connectorId string) (*ConnectorResponse, error) {
  4954  	return c.RetrieveConnectorWithContext(context.TODO(), connectorId)
  4955  }
  4956  
  4957  // RetrieveConnectorWithContext
  4958  // Retrieves the connector with the given Id.
  4959  //
  4960  //	string connectorId The Id of the connector.
  4961  func (c *FusionAuthClient) RetrieveConnectorWithContext(ctx context.Context, connectorId string) (*ConnectorResponse, error) {
  4962  	var resp ConnectorResponse
  4963  
  4964  	err := c.Start(&resp, nil).
  4965  		WithUri("/api/connector").
  4966  		WithUriSegment(connectorId).
  4967  		WithMethod(http.MethodGet).
  4968  		Do(ctx)
  4969  	return &resp, err
  4970  }
  4971  
  4972  // RetrieveConnectors
  4973  // Retrieves all the connectors.
  4974  func (c *FusionAuthClient) RetrieveConnectors() (*ConnectorResponse, error) {
  4975  	return c.RetrieveConnectorsWithContext(context.TODO())
  4976  }
  4977  
  4978  // RetrieveConnectorsWithContext
  4979  // Retrieves all the connectors.
  4980  func (c *FusionAuthClient) RetrieveConnectorsWithContext(ctx context.Context) (*ConnectorResponse, error) {
  4981  	var resp ConnectorResponse
  4982  
  4983  	err := c.Start(&resp, nil).
  4984  		WithUri("/api/connector").
  4985  		WithMethod(http.MethodGet).
  4986  		Do(ctx)
  4987  	return &resp, err
  4988  }
  4989  
  4990  // RetrieveConsent
  4991  // Retrieves the Consent for the given Id.
  4992  //
  4993  //	string consentId The Id of the consent.
  4994  func (c *FusionAuthClient) RetrieveConsent(consentId string) (*ConsentResponse, error) {
  4995  	return c.RetrieveConsentWithContext(context.TODO(), consentId)
  4996  }
  4997  
  4998  // RetrieveConsentWithContext
  4999  // Retrieves the Consent for the given Id.
  5000  //
  5001  //	string consentId The Id of the consent.
  5002  func (c *FusionAuthClient) RetrieveConsentWithContext(ctx context.Context, consentId string) (*ConsentResponse, error) {
  5003  	var resp ConsentResponse
  5004  
  5005  	err := c.Start(&resp, nil).
  5006  		WithUri("/api/consent").
  5007  		WithUriSegment(consentId).
  5008  		WithMethod(http.MethodGet).
  5009  		Do(ctx)
  5010  	return &resp, err
  5011  }
  5012  
  5013  // RetrieveConsents
  5014  // Retrieves all the consent.
  5015  func (c *FusionAuthClient) RetrieveConsents() (*ConsentResponse, error) {
  5016  	return c.RetrieveConsentsWithContext(context.TODO())
  5017  }
  5018  
  5019  // RetrieveConsentsWithContext
  5020  // Retrieves all the consent.
  5021  func (c *FusionAuthClient) RetrieveConsentsWithContext(ctx context.Context) (*ConsentResponse, error) {
  5022  	var resp ConsentResponse
  5023  
  5024  	err := c.Start(&resp, nil).
  5025  		WithUri("/api/consent").
  5026  		WithMethod(http.MethodGet).
  5027  		Do(ctx)
  5028  	return &resp, err
  5029  }
  5030  
  5031  // RetrieveDailyActiveReport
  5032  // Retrieves the daily active user report between the two instants. If you specify an application id, it will only
  5033  // return the daily active counts for that application.
  5034  //
  5035  //	string applicationId (Optional) The application id.
  5036  //	int64 start The start instant as UTC milliseconds since Epoch.
  5037  //	int64 end The end instant as UTC milliseconds since Epoch.
  5038  func (c *FusionAuthClient) RetrieveDailyActiveReport(applicationId string, start int64, end int64) (*DailyActiveUserReportResponse, *Errors, error) {
  5039  	return c.RetrieveDailyActiveReportWithContext(context.TODO(), applicationId, start, end)
  5040  }
  5041  
  5042  // RetrieveDailyActiveReportWithContext
  5043  // Retrieves the daily active user report between the two instants. If you specify an application id, it will only
  5044  // return the daily active counts for that application.
  5045  //
  5046  //	string applicationId (Optional) The application id.
  5047  //	int64 start The start instant as UTC milliseconds since Epoch.
  5048  //	int64 end The end instant as UTC milliseconds since Epoch.
  5049  func (c *FusionAuthClient) RetrieveDailyActiveReportWithContext(ctx context.Context, applicationId string, start int64, end int64) (*DailyActiveUserReportResponse, *Errors, error) {
  5050  	var resp DailyActiveUserReportResponse
  5051  	var errors Errors
  5052  
  5053  	restClient := c.Start(&resp, &errors)
  5054  	err := restClient.WithUri("/api/report/daily-active-user").
  5055  		WithParameter("applicationId", applicationId).
  5056  		WithParameter("start", strconv.FormatInt(start, 10)).
  5057  		WithParameter("end", strconv.FormatInt(end, 10)).
  5058  		WithMethod(http.MethodGet).
  5059  		Do(ctx)
  5060  	if restClient.ErrorRef == nil {
  5061  		return &resp, nil, err
  5062  	}
  5063  	return &resp, &errors, err
  5064  }
  5065  
  5066  // RetrieveEmailTemplate
  5067  // Retrieves the email template for the given Id. If you don't specify the id, this will return all the email templates.
  5068  //
  5069  //	string emailTemplateId (Optional) The Id of the email template.
  5070  func (c *FusionAuthClient) RetrieveEmailTemplate(emailTemplateId string) (*EmailTemplateResponse, error) {
  5071  	return c.RetrieveEmailTemplateWithContext(context.TODO(), emailTemplateId)
  5072  }
  5073  
  5074  // RetrieveEmailTemplateWithContext
  5075  // Retrieves the email template for the given Id. If you don't specify the id, this will return all the email templates.
  5076  //
  5077  //	string emailTemplateId (Optional) The Id of the email template.
  5078  func (c *FusionAuthClient) RetrieveEmailTemplateWithContext(ctx context.Context, emailTemplateId string) (*EmailTemplateResponse, error) {
  5079  	var resp EmailTemplateResponse
  5080  
  5081  	err := c.Start(&resp, nil).
  5082  		WithUri("/api/email/template").
  5083  		WithUriSegment(emailTemplateId).
  5084  		WithMethod(http.MethodGet).
  5085  		Do(ctx)
  5086  	return &resp, err
  5087  }
  5088  
  5089  // RetrieveEmailTemplatePreview
  5090  // Creates a preview of the email template provided in the request. This allows you to preview an email template that
  5091  // hasn't been saved to the database yet. The entire email template does not need to be provided on the request. This
  5092  // will create the preview based on whatever is given.
  5093  //
  5094  //	PreviewRequest request The request that contains the email template and optionally a locale to render it in.
  5095  func (c *FusionAuthClient) RetrieveEmailTemplatePreview(request PreviewRequest) (*PreviewResponse, *Errors, error) {
  5096  	return c.RetrieveEmailTemplatePreviewWithContext(context.TODO(), request)
  5097  }
  5098  
  5099  // RetrieveEmailTemplatePreviewWithContext
  5100  // Creates a preview of the email template provided in the request. This allows you to preview an email template that
  5101  // hasn't been saved to the database yet. The entire email template does not need to be provided on the request. This
  5102  // will create the preview based on whatever is given.
  5103  //
  5104  //	PreviewRequest request The request that contains the email template and optionally a locale to render it in.
  5105  func (c *FusionAuthClient) RetrieveEmailTemplatePreviewWithContext(ctx context.Context, request PreviewRequest) (*PreviewResponse, *Errors, error) {
  5106  	var resp PreviewResponse
  5107  	var errors Errors
  5108  
  5109  	restClient := c.Start(&resp, &errors)
  5110  	err := restClient.WithUri("/api/email/template/preview").
  5111  		WithJSONBody(request).
  5112  		WithMethod(http.MethodPost).
  5113  		Do(ctx)
  5114  	if restClient.ErrorRef == nil {
  5115  		return &resp, nil, err
  5116  	}
  5117  	return &resp, &errors, err
  5118  }
  5119  
  5120  // RetrieveEmailTemplates
  5121  // Retrieves all the email templates.
  5122  func (c *FusionAuthClient) RetrieveEmailTemplates() (*EmailTemplateResponse, error) {
  5123  	return c.RetrieveEmailTemplatesWithContext(context.TODO())
  5124  }
  5125  
  5126  // RetrieveEmailTemplatesWithContext
  5127  // Retrieves all the email templates.
  5128  func (c *FusionAuthClient) RetrieveEmailTemplatesWithContext(ctx context.Context) (*EmailTemplateResponse, error) {
  5129  	var resp EmailTemplateResponse
  5130  
  5131  	err := c.Start(&resp, nil).
  5132  		WithUri("/api/email/template").
  5133  		WithMethod(http.MethodGet).
  5134  		Do(ctx)
  5135  	return &resp, err
  5136  }
  5137  
  5138  // RetrieveEntity
  5139  // Retrieves the Entity for the given Id.
  5140  //
  5141  //	string entityId The Id of the Entity.
  5142  func (c *FusionAuthClient) RetrieveEntity(entityId string) (*EntityResponse, *Errors, error) {
  5143  	return c.RetrieveEntityWithContext(context.TODO(), entityId)
  5144  }
  5145  
  5146  // RetrieveEntityWithContext
  5147  // Retrieves the Entity for the given Id.
  5148  //
  5149  //	string entityId The Id of the Entity.
  5150  func (c *FusionAuthClient) RetrieveEntityWithContext(ctx context.Context, entityId string) (*EntityResponse, *Errors, error) {
  5151  	var resp EntityResponse
  5152  	var errors Errors
  5153  
  5154  	restClient := c.Start(&resp, &errors)
  5155  	err := restClient.WithUri("/api/entity").
  5156  		WithUriSegment(entityId).
  5157  		WithMethod(http.MethodGet).
  5158  		Do(ctx)
  5159  	if restClient.ErrorRef == nil {
  5160  		return &resp, nil, err
  5161  	}
  5162  	return &resp, &errors, err
  5163  }
  5164  
  5165  // RetrieveEntityGrant
  5166  // Retrieves an Entity Grant for the given Entity and User/Entity.
  5167  //
  5168  //	string entityId The Id of the Entity.
  5169  //	string recipientEntityId (Optional) The Id of the Entity that the Entity Grant is for.
  5170  //	string userId (Optional) The Id of the User that the Entity Grant is for.
  5171  func (c *FusionAuthClient) RetrieveEntityGrant(entityId string, recipientEntityId string, userId string) (*EntityGrantResponse, *Errors, error) {
  5172  	return c.RetrieveEntityGrantWithContext(context.TODO(), entityId, recipientEntityId, userId)
  5173  }
  5174  
  5175  // RetrieveEntityGrantWithContext
  5176  // Retrieves an Entity Grant for the given Entity and User/Entity.
  5177  //
  5178  //	string entityId The Id of the Entity.
  5179  //	string recipientEntityId (Optional) The Id of the Entity that the Entity Grant is for.
  5180  //	string userId (Optional) The Id of the User that the Entity Grant is for.
  5181  func (c *FusionAuthClient) RetrieveEntityGrantWithContext(ctx context.Context, entityId string, recipientEntityId string, userId string) (*EntityGrantResponse, *Errors, error) {
  5182  	var resp EntityGrantResponse
  5183  	var errors Errors
  5184  
  5185  	restClient := c.Start(&resp, &errors)
  5186  	err := restClient.WithUri("/api/entity").
  5187  		WithUriSegment(entityId).
  5188  		WithUriSegment("grant").
  5189  		WithParameter("recipientEntityId", recipientEntityId).
  5190  		WithParameter("userId", userId).
  5191  		WithMethod(http.MethodGet).
  5192  		Do(ctx)
  5193  	if restClient.ErrorRef == nil {
  5194  		return &resp, nil, err
  5195  	}
  5196  	return &resp, &errors, err
  5197  }
  5198  
  5199  // RetrieveEntityType
  5200  // Retrieves the Entity Type for the given Id.
  5201  //
  5202  //	string entityTypeId The Id of the Entity Type.
  5203  func (c *FusionAuthClient) RetrieveEntityType(entityTypeId string) (*EntityTypeResponse, *Errors, error) {
  5204  	return c.RetrieveEntityTypeWithContext(context.TODO(), entityTypeId)
  5205  }
  5206  
  5207  // RetrieveEntityTypeWithContext
  5208  // Retrieves the Entity Type for the given Id.
  5209  //
  5210  //	string entityTypeId The Id of the Entity Type.
  5211  func (c *FusionAuthClient) RetrieveEntityTypeWithContext(ctx context.Context, entityTypeId string) (*EntityTypeResponse, *Errors, error) {
  5212  	var resp EntityTypeResponse
  5213  	var errors Errors
  5214  
  5215  	restClient := c.Start(&resp, &errors)
  5216  	err := restClient.WithUri("/api/entity/type").
  5217  		WithUriSegment(entityTypeId).
  5218  		WithMethod(http.MethodGet).
  5219  		Do(ctx)
  5220  	if restClient.ErrorRef == nil {
  5221  		return &resp, nil, err
  5222  	}
  5223  	return &resp, &errors, err
  5224  }
  5225  
  5226  // RetrieveEntityTypes
  5227  // Retrieves all the Entity Types.
  5228  func (c *FusionAuthClient) RetrieveEntityTypes() (*EntityTypeResponse, *Errors, error) {
  5229  	return c.RetrieveEntityTypesWithContext(context.TODO())
  5230  }
  5231  
  5232  // RetrieveEntityTypesWithContext
  5233  // Retrieves all the Entity Types.
  5234  func (c *FusionAuthClient) RetrieveEntityTypesWithContext(ctx context.Context) (*EntityTypeResponse, *Errors, error) {
  5235  	var resp EntityTypeResponse
  5236  	var errors Errors
  5237  
  5238  	restClient := c.Start(&resp, &errors)
  5239  	err := restClient.WithUri("/api/entity/type").
  5240  		WithMethod(http.MethodGet).
  5241  		Do(ctx)
  5242  	if restClient.ErrorRef == nil {
  5243  		return &resp, nil, err
  5244  	}
  5245  	return &resp, &errors, err
  5246  }
  5247  
  5248  // RetrieveEventLog
  5249  // Retrieves a single event log for the given Id.
  5250  //
  5251  //	int eventLogId The Id of the event log to retrieve.
  5252  func (c *FusionAuthClient) RetrieveEventLog(eventLogId int) (*EventLogResponse, *Errors, error) {
  5253  	return c.RetrieveEventLogWithContext(context.TODO(), eventLogId)
  5254  }
  5255  
  5256  // RetrieveEventLogWithContext
  5257  // Retrieves a single event log for the given Id.
  5258  //
  5259  //	int eventLogId The Id of the event log to retrieve.
  5260  func (c *FusionAuthClient) RetrieveEventLogWithContext(ctx context.Context, eventLogId int) (*EventLogResponse, *Errors, error) {
  5261  	var resp EventLogResponse
  5262  	var errors Errors
  5263  
  5264  	restClient := c.Start(&resp, &errors)
  5265  	err := restClient.WithUri("/api/system/event-log").
  5266  		WithUriSegment(strconv.Itoa(eventLogId)).
  5267  		WithMethod(http.MethodGet).
  5268  		Do(ctx)
  5269  	if restClient.ErrorRef == nil {
  5270  		return &resp, nil, err
  5271  	}
  5272  	return &resp, &errors, err
  5273  }
  5274  
  5275  // RetrieveFamilies
  5276  // Retrieves all the families that a user belongs to.
  5277  //
  5278  //	string userId The User's id
  5279  func (c *FusionAuthClient) RetrieveFamilies(userId string) (*FamilyResponse, error) {
  5280  	return c.RetrieveFamiliesWithContext(context.TODO(), userId)
  5281  }
  5282  
  5283  // RetrieveFamiliesWithContext
  5284  // Retrieves all the families that a user belongs to.
  5285  //
  5286  //	string userId The User's id
  5287  func (c *FusionAuthClient) RetrieveFamiliesWithContext(ctx context.Context, userId string) (*FamilyResponse, error) {
  5288  	var resp FamilyResponse
  5289  
  5290  	err := c.Start(&resp, nil).
  5291  		WithUri("/api/user/family").
  5292  		WithParameter("userId", userId).
  5293  		WithMethod(http.MethodGet).
  5294  		Do(ctx)
  5295  	return &resp, err
  5296  }
  5297  
  5298  // RetrieveFamilyMembersByFamilyId
  5299  // Retrieves all the members of a family by the unique Family Id.
  5300  //
  5301  //	string familyId The unique Id of the Family.
  5302  func (c *FusionAuthClient) RetrieveFamilyMembersByFamilyId(familyId string) (*FamilyResponse, error) {
  5303  	return c.RetrieveFamilyMembersByFamilyIdWithContext(context.TODO(), familyId)
  5304  }
  5305  
  5306  // RetrieveFamilyMembersByFamilyIdWithContext
  5307  // Retrieves all the members of a family by the unique Family Id.
  5308  //
  5309  //	string familyId The unique Id of the Family.
  5310  func (c *FusionAuthClient) RetrieveFamilyMembersByFamilyIdWithContext(ctx context.Context, familyId string) (*FamilyResponse, error) {
  5311  	var resp FamilyResponse
  5312  
  5313  	err := c.Start(&resp, nil).
  5314  		WithUri("/api/user/family").
  5315  		WithUriSegment(familyId).
  5316  		WithMethod(http.MethodGet).
  5317  		Do(ctx)
  5318  	return &resp, err
  5319  }
  5320  
  5321  // RetrieveForm
  5322  // Retrieves the form with the given Id.
  5323  //
  5324  //	string formId The Id of the form.
  5325  func (c *FusionAuthClient) RetrieveForm(formId string) (*FormResponse, error) {
  5326  	return c.RetrieveFormWithContext(context.TODO(), formId)
  5327  }
  5328  
  5329  // RetrieveFormWithContext
  5330  // Retrieves the form with the given Id.
  5331  //
  5332  //	string formId The Id of the form.
  5333  func (c *FusionAuthClient) RetrieveFormWithContext(ctx context.Context, formId string) (*FormResponse, error) {
  5334  	var resp FormResponse
  5335  
  5336  	err := c.Start(&resp, nil).
  5337  		WithUri("/api/form").
  5338  		WithUriSegment(formId).
  5339  		WithMethod(http.MethodGet).
  5340  		Do(ctx)
  5341  	return &resp, err
  5342  }
  5343  
  5344  // RetrieveFormField
  5345  // Retrieves the form field with the given Id.
  5346  //
  5347  //	string fieldId The Id of the form field.
  5348  func (c *FusionAuthClient) RetrieveFormField(fieldId string) (*FormFieldResponse, error) {
  5349  	return c.RetrieveFormFieldWithContext(context.TODO(), fieldId)
  5350  }
  5351  
  5352  // RetrieveFormFieldWithContext
  5353  // Retrieves the form field with the given Id.
  5354  //
  5355  //	string fieldId The Id of the form field.
  5356  func (c *FusionAuthClient) RetrieveFormFieldWithContext(ctx context.Context, fieldId string) (*FormFieldResponse, error) {
  5357  	var resp FormFieldResponse
  5358  
  5359  	err := c.Start(&resp, nil).
  5360  		WithUri("/api/form/field").
  5361  		WithUriSegment(fieldId).
  5362  		WithMethod(http.MethodGet).
  5363  		Do(ctx)
  5364  	return &resp, err
  5365  }
  5366  
  5367  // RetrieveFormFields
  5368  // Retrieves all the forms fields
  5369  func (c *FusionAuthClient) RetrieveFormFields() (*FormFieldResponse, error) {
  5370  	return c.RetrieveFormFieldsWithContext(context.TODO())
  5371  }
  5372  
  5373  // RetrieveFormFieldsWithContext
  5374  // Retrieves all the forms fields
  5375  func (c *FusionAuthClient) RetrieveFormFieldsWithContext(ctx context.Context) (*FormFieldResponse, error) {
  5376  	var resp FormFieldResponse
  5377  
  5378  	err := c.Start(&resp, nil).
  5379  		WithUri("/api/form/field").
  5380  		WithMethod(http.MethodGet).
  5381  		Do(ctx)
  5382  	return &resp, err
  5383  }
  5384  
  5385  // RetrieveForms
  5386  // Retrieves all the forms.
  5387  func (c *FusionAuthClient) RetrieveForms() (*FormResponse, error) {
  5388  	return c.RetrieveFormsWithContext(context.TODO())
  5389  }
  5390  
  5391  // RetrieveFormsWithContext
  5392  // Retrieves all the forms.
  5393  func (c *FusionAuthClient) RetrieveFormsWithContext(ctx context.Context) (*FormResponse, error) {
  5394  	var resp FormResponse
  5395  
  5396  	err := c.Start(&resp, nil).
  5397  		WithUri("/api/form").
  5398  		WithMethod(http.MethodGet).
  5399  		Do(ctx)
  5400  	return &resp, err
  5401  }
  5402  
  5403  // RetrieveGroup
  5404  // Retrieves the group for the given Id.
  5405  //
  5406  //	string groupId The Id of the group.
  5407  func (c *FusionAuthClient) RetrieveGroup(groupId string) (*GroupResponse, *Errors, error) {
  5408  	return c.RetrieveGroupWithContext(context.TODO(), groupId)
  5409  }
  5410  
  5411  // RetrieveGroupWithContext
  5412  // Retrieves the group for the given Id.
  5413  //
  5414  //	string groupId The Id of the group.
  5415  func (c *FusionAuthClient) RetrieveGroupWithContext(ctx context.Context, groupId string) (*GroupResponse, *Errors, error) {
  5416  	var resp GroupResponse
  5417  	var errors Errors
  5418  
  5419  	restClient := c.Start(&resp, &errors)
  5420  	err := restClient.WithUri("/api/group").
  5421  		WithUriSegment(groupId).
  5422  		WithMethod(http.MethodGet).
  5423  		Do(ctx)
  5424  	if restClient.ErrorRef == nil {
  5425  		return &resp, nil, err
  5426  	}
  5427  	return &resp, &errors, err
  5428  }
  5429  
  5430  // RetrieveGroups
  5431  // Retrieves all the groups.
  5432  func (c *FusionAuthClient) RetrieveGroups() (*GroupResponse, error) {
  5433  	return c.RetrieveGroupsWithContext(context.TODO())
  5434  }
  5435  
  5436  // RetrieveGroupsWithContext
  5437  // Retrieves all the groups.
  5438  func (c *FusionAuthClient) RetrieveGroupsWithContext(ctx context.Context) (*GroupResponse, error) {
  5439  	var resp GroupResponse
  5440  
  5441  	err := c.Start(&resp, nil).
  5442  		WithUri("/api/group").
  5443  		WithMethod(http.MethodGet).
  5444  		Do(ctx)
  5445  	return &resp, err
  5446  }
  5447  
  5448  // RetrieveIPAccessControlList
  5449  // Retrieves the IP Access Control List with the given Id.
  5450  //
  5451  //	string ipAccessControlListId The Id of the IP Access Control List.
  5452  func (c *FusionAuthClient) RetrieveIPAccessControlList(ipAccessControlListId string) (*IPAccessControlListResponse, error) {
  5453  	return c.RetrieveIPAccessControlListWithContext(context.TODO(), ipAccessControlListId)
  5454  }
  5455  
  5456  // RetrieveIPAccessControlListWithContext
  5457  // Retrieves the IP Access Control List with the given Id.
  5458  //
  5459  //	string ipAccessControlListId The Id of the IP Access Control List.
  5460  func (c *FusionAuthClient) RetrieveIPAccessControlListWithContext(ctx context.Context, ipAccessControlListId string) (*IPAccessControlListResponse, error) {
  5461  	var resp IPAccessControlListResponse
  5462  
  5463  	err := c.Start(&resp, nil).
  5464  		WithUri("/api/ip-acl").
  5465  		WithUriSegment(ipAccessControlListId).
  5466  		WithMethod(http.MethodGet).
  5467  		Do(ctx)
  5468  	return &resp, err
  5469  }
  5470  
  5471  // RetrieveIdentityProviderByType
  5472  // Retrieves one or more identity provider for the given type. For types such as Google, Facebook, Twitter and LinkedIn, only a single
  5473  // identity provider can exist. For types such as OpenID Connect and SAMLv2 more than one identity provider can be configured so this request
  5474  // may return multiple identity providers.
  5475  //
  5476  //	IdentityProviderType _type The type of the identity provider.
  5477  func (c *FusionAuthClient) RetrieveIdentityProviderByType(_type IdentityProviderType) (*IdentityProviderResponse, *Errors, error) {
  5478  	return c.RetrieveIdentityProviderByTypeWithContext(context.TODO(), _type)
  5479  }
  5480  
  5481  // RetrieveIdentityProviderByTypeWithContext
  5482  // Retrieves one or more identity provider for the given type. For types such as Google, Facebook, Twitter and LinkedIn, only a single
  5483  // identity provider can exist. For types such as OpenID Connect and SAMLv2 more than one identity provider can be configured so this request
  5484  // may return multiple identity providers.
  5485  //
  5486  //	IdentityProviderType _type The type of the identity provider.
  5487  func (c *FusionAuthClient) RetrieveIdentityProviderByTypeWithContext(ctx context.Context, _type IdentityProviderType) (*IdentityProviderResponse, *Errors, error) {
  5488  	var resp IdentityProviderResponse
  5489  	var errors Errors
  5490  
  5491  	restClient := c.Start(&resp, &errors)
  5492  	err := restClient.WithUri("/api/identity-provider").
  5493  		WithParameter("type", string(_type)).
  5494  		WithMethod(http.MethodGet).
  5495  		Do(ctx)
  5496  	if restClient.ErrorRef == nil {
  5497  		return &resp, nil, err
  5498  	}
  5499  	return &resp, &errors, err
  5500  }
  5501  
  5502  // RetrieveInactiveActions
  5503  // Retrieves all the actions for the user with the given Id that are currently inactive.
  5504  // An inactive action means one that is time based and has been canceled or has expired, or is not time based.
  5505  //
  5506  //	string userId The Id of the user to fetch the actions for.
  5507  func (c *FusionAuthClient) RetrieveInactiveActions(userId string) (*ActionResponse, *Errors, error) {
  5508  	return c.RetrieveInactiveActionsWithContext(context.TODO(), userId)
  5509  }
  5510  
  5511  // RetrieveInactiveActionsWithContext
  5512  // Retrieves all the actions for the user with the given Id that are currently inactive.
  5513  // An inactive action means one that is time based and has been canceled or has expired, or is not time based.
  5514  //
  5515  //	string userId The Id of the user to fetch the actions for.
  5516  func (c *FusionAuthClient) RetrieveInactiveActionsWithContext(ctx context.Context, userId string) (*ActionResponse, *Errors, error) {
  5517  	var resp ActionResponse
  5518  	var errors Errors
  5519  
  5520  	restClient := c.Start(&resp, &errors)
  5521  	err := restClient.WithUri("/api/user/action").
  5522  		WithParameter("userId", userId).
  5523  		WithParameter("active", strconv.FormatBool(false)).
  5524  		WithMethod(http.MethodGet).
  5525  		Do(ctx)
  5526  	if restClient.ErrorRef == nil {
  5527  		return &resp, nil, err
  5528  	}
  5529  	return &resp, &errors, err
  5530  }
  5531  
  5532  // RetrieveInactiveApplications
  5533  // Retrieves all the applications that are currently inactive.
  5534  func (c *FusionAuthClient) RetrieveInactiveApplications() (*ApplicationResponse, error) {
  5535  	return c.RetrieveInactiveApplicationsWithContext(context.TODO())
  5536  }
  5537  
  5538  // RetrieveInactiveApplicationsWithContext
  5539  // Retrieves all the applications that are currently inactive.
  5540  func (c *FusionAuthClient) RetrieveInactiveApplicationsWithContext(ctx context.Context) (*ApplicationResponse, error) {
  5541  	var resp ApplicationResponse
  5542  
  5543  	err := c.Start(&resp, nil).
  5544  		WithUri("/api/application").
  5545  		WithParameter("inactive", strconv.FormatBool(true)).
  5546  		WithMethod(http.MethodGet).
  5547  		Do(ctx)
  5548  	return &resp, err
  5549  }
  5550  
  5551  // RetrieveInactiveUserActions
  5552  // Retrieves all the user actions that are currently inactive.
  5553  func (c *FusionAuthClient) RetrieveInactiveUserActions() (*UserActionResponse, error) {
  5554  	return c.RetrieveInactiveUserActionsWithContext(context.TODO())
  5555  }
  5556  
  5557  // RetrieveInactiveUserActionsWithContext
  5558  // Retrieves all the user actions that are currently inactive.
  5559  func (c *FusionAuthClient) RetrieveInactiveUserActionsWithContext(ctx context.Context) (*UserActionResponse, error) {
  5560  	var resp UserActionResponse
  5561  
  5562  	err := c.Start(&resp, nil).
  5563  		WithUri("/api/user-action").
  5564  		WithParameter("inactive", strconv.FormatBool(true)).
  5565  		WithMethod(http.MethodGet).
  5566  		Do(ctx)
  5567  	return &resp, err
  5568  }
  5569  
  5570  // RetrieveIntegration
  5571  // Retrieves the available integrations.
  5572  func (c *FusionAuthClient) RetrieveIntegration() (*IntegrationResponse, error) {
  5573  	return c.RetrieveIntegrationWithContext(context.TODO())
  5574  }
  5575  
  5576  // RetrieveIntegrationWithContext
  5577  // Retrieves the available integrations.
  5578  func (c *FusionAuthClient) RetrieveIntegrationWithContext(ctx context.Context) (*IntegrationResponse, error) {
  5579  	var resp IntegrationResponse
  5580  
  5581  	err := c.Start(&resp, nil).
  5582  		WithUri("/api/integration").
  5583  		WithMethod(http.MethodGet).
  5584  		Do(ctx)
  5585  	return &resp, err
  5586  }
  5587  
  5588  // RetrieveJWTPublicKey
  5589  // Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).
  5590  //
  5591  //	string keyId The Id of the public key (kid).
  5592  func (c *FusionAuthClient) RetrieveJWTPublicKey(keyId string) (*PublicKeyResponse, error) {
  5593  	return c.RetrieveJWTPublicKeyWithContext(context.TODO(), keyId)
  5594  }
  5595  
  5596  // RetrieveJWTPublicKeyWithContext
  5597  // Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid).
  5598  //
  5599  //	string keyId The Id of the public key (kid).
  5600  func (c *FusionAuthClient) RetrieveJWTPublicKeyWithContext(ctx context.Context, keyId string) (*PublicKeyResponse, error) {
  5601  	var resp PublicKeyResponse
  5602  
  5603  	err := c.StartAnonymous(&resp, nil).
  5604  		WithUri("/api/jwt/public-key").
  5605  		WithParameter("kid", keyId).
  5606  		WithMethod(http.MethodGet).
  5607  		Do(ctx)
  5608  	return &resp, err
  5609  }
  5610  
  5611  // RetrieveJWTPublicKeyByApplicationId
  5612  // Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.
  5613  //
  5614  //	string applicationId The Id of the Application for which this key is used.
  5615  func (c *FusionAuthClient) RetrieveJWTPublicKeyByApplicationId(applicationId string) (*PublicKeyResponse, error) {
  5616  	return c.RetrieveJWTPublicKeyByApplicationIdWithContext(context.TODO(), applicationId)
  5617  }
  5618  
  5619  // RetrieveJWTPublicKeyByApplicationIdWithContext
  5620  // Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id.
  5621  //
  5622  //	string applicationId The Id of the Application for which this key is used.
  5623  func (c *FusionAuthClient) RetrieveJWTPublicKeyByApplicationIdWithContext(ctx context.Context, applicationId string) (*PublicKeyResponse, error) {
  5624  	var resp PublicKeyResponse
  5625  
  5626  	err := c.StartAnonymous(&resp, nil).
  5627  		WithUri("/api/jwt/public-key").
  5628  		WithParameter("applicationId", applicationId).
  5629  		WithMethod(http.MethodGet).
  5630  		Do(ctx)
  5631  	return &resp, err
  5632  }
  5633  
  5634  // RetrieveJWTPublicKeys
  5635  // Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).
  5636  func (c *FusionAuthClient) RetrieveJWTPublicKeys() (*PublicKeyResponse, error) {
  5637  	return c.RetrieveJWTPublicKeysWithContext(context.TODO())
  5638  }
  5639  
  5640  // RetrieveJWTPublicKeysWithContext
  5641  // Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT).
  5642  func (c *FusionAuthClient) RetrieveJWTPublicKeysWithContext(ctx context.Context) (*PublicKeyResponse, error) {
  5643  	var resp PublicKeyResponse
  5644  
  5645  	err := c.StartAnonymous(&resp, nil).
  5646  		WithUri("/api/jwt/public-key").
  5647  		WithMethod(http.MethodGet).
  5648  		Do(ctx)
  5649  	return &resp, err
  5650  }
  5651  
  5652  // RetrieveJsonWebKeySet
  5653  // Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format.
  5654  func (c *FusionAuthClient) RetrieveJsonWebKeySet() (*JWKSResponse, error) {
  5655  	return c.RetrieveJsonWebKeySetWithContext(context.TODO())
  5656  }
  5657  
  5658  // RetrieveJsonWebKeySetWithContext
  5659  // Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format.
  5660  func (c *FusionAuthClient) RetrieveJsonWebKeySetWithContext(ctx context.Context) (*JWKSResponse, error) {
  5661  	var resp JWKSResponse
  5662  
  5663  	err := c.StartAnonymous(&resp, nil).
  5664  		WithUri("/.well-known/jwks.json").
  5665  		WithMethod(http.MethodGet).
  5666  		Do(ctx)
  5667  	return &resp, err
  5668  }
  5669  
  5670  // RetrieveKey
  5671  // Retrieves the key for the given Id.
  5672  //
  5673  //	string keyId The Id of the key.
  5674  func (c *FusionAuthClient) RetrieveKey(keyId string) (*KeyResponse, *Errors, error) {
  5675  	return c.RetrieveKeyWithContext(context.TODO(), keyId)
  5676  }
  5677  
  5678  // RetrieveKeyWithContext
  5679  // Retrieves the key for the given Id.
  5680  //
  5681  //	string keyId The Id of the key.
  5682  func (c *FusionAuthClient) RetrieveKeyWithContext(ctx context.Context, keyId string) (*KeyResponse, *Errors, error) {
  5683  	var resp KeyResponse
  5684  	var errors Errors
  5685  
  5686  	restClient := c.Start(&resp, &errors)
  5687  	err := restClient.WithUri("/api/key").
  5688  		WithUriSegment(keyId).
  5689  		WithMethod(http.MethodGet).
  5690  		Do(ctx)
  5691  	if restClient.ErrorRef == nil {
  5692  		return &resp, nil, err
  5693  	}
  5694  	return &resp, &errors, err
  5695  }
  5696  
  5697  // RetrieveKeys
  5698  // Retrieves all the keys.
  5699  func (c *FusionAuthClient) RetrieveKeys() (*KeyResponse, error) {
  5700  	return c.RetrieveKeysWithContext(context.TODO())
  5701  }
  5702  
  5703  // RetrieveKeysWithContext
  5704  // Retrieves all the keys.
  5705  func (c *FusionAuthClient) RetrieveKeysWithContext(ctx context.Context) (*KeyResponse, error) {
  5706  	var resp KeyResponse
  5707  
  5708  	err := c.Start(&resp, nil).
  5709  		WithUri("/api/key").
  5710  		WithMethod(http.MethodGet).
  5711  		Do(ctx)
  5712  	return &resp, err
  5713  }
  5714  
  5715  // RetrieveLambda
  5716  // Retrieves the lambda for the given Id.
  5717  //
  5718  //	string lambdaId The Id of the lambda.
  5719  func (c *FusionAuthClient) RetrieveLambda(lambdaId string) (*LambdaResponse, *Errors, error) {
  5720  	return c.RetrieveLambdaWithContext(context.TODO(), lambdaId)
  5721  }
  5722  
  5723  // RetrieveLambdaWithContext
  5724  // Retrieves the lambda for the given Id.
  5725  //
  5726  //	string lambdaId The Id of the lambda.
  5727  func (c *FusionAuthClient) RetrieveLambdaWithContext(ctx context.Context, lambdaId string) (*LambdaResponse, *Errors, error) {
  5728  	var resp LambdaResponse
  5729  	var errors Errors
  5730  
  5731  	restClient := c.Start(&resp, &errors)
  5732  	err := restClient.WithUri("/api/lambda").
  5733  		WithUriSegment(lambdaId).
  5734  		WithMethod(http.MethodGet).
  5735  		Do(ctx)
  5736  	if restClient.ErrorRef == nil {
  5737  		return &resp, nil, err
  5738  	}
  5739  	return &resp, &errors, err
  5740  }
  5741  
  5742  // RetrieveLambdas
  5743  // Retrieves all the lambdas.
  5744  func (c *FusionAuthClient) RetrieveLambdas() (*LambdaResponse, error) {
  5745  	return c.RetrieveLambdasWithContext(context.TODO())
  5746  }
  5747  
  5748  // RetrieveLambdasWithContext
  5749  // Retrieves all the lambdas.
  5750  func (c *FusionAuthClient) RetrieveLambdasWithContext(ctx context.Context) (*LambdaResponse, error) {
  5751  	var resp LambdaResponse
  5752  
  5753  	err := c.Start(&resp, nil).
  5754  		WithUri("/api/lambda").
  5755  		WithMethod(http.MethodGet).
  5756  		Do(ctx)
  5757  	return &resp, err
  5758  }
  5759  
  5760  // RetrieveLambdasByType
  5761  // Retrieves all the lambdas for the provided type.
  5762  //
  5763  //	LambdaType _type The type of the lambda to return.
  5764  func (c *FusionAuthClient) RetrieveLambdasByType(_type LambdaType) (*LambdaResponse, error) {
  5765  	return c.RetrieveLambdasByTypeWithContext(context.TODO(), _type)
  5766  }
  5767  
  5768  // RetrieveLambdasByTypeWithContext
  5769  // Retrieves all the lambdas for the provided type.
  5770  //
  5771  //	LambdaType _type The type of the lambda to return.
  5772  func (c *FusionAuthClient) RetrieveLambdasByTypeWithContext(ctx context.Context, _type LambdaType) (*LambdaResponse, error) {
  5773  	var resp LambdaResponse
  5774  
  5775  	err := c.Start(&resp, nil).
  5776  		WithUri("/api/lambda").
  5777  		WithParameter("type", string(_type)).
  5778  		WithMethod(http.MethodGet).
  5779  		Do(ctx)
  5780  	return &resp, err
  5781  }
  5782  
  5783  // RetrieveLoginReport
  5784  // Retrieves the login report between the two instants. If you specify an application id, it will only return the
  5785  // login counts for that application.
  5786  //
  5787  //	string applicationId (Optional) The application id.
  5788  //	int64 start The start instant as UTC milliseconds since Epoch.
  5789  //	int64 end The end instant as UTC milliseconds since Epoch.
  5790  func (c *FusionAuthClient) RetrieveLoginReport(applicationId string, start int64, end int64) (*LoginReportResponse, *Errors, error) {
  5791  	return c.RetrieveLoginReportWithContext(context.TODO(), applicationId, start, end)
  5792  }
  5793  
  5794  // RetrieveLoginReportWithContext
  5795  // Retrieves the login report between the two instants. If you specify an application id, it will only return the
  5796  // login counts for that application.
  5797  //
  5798  //	string applicationId (Optional) The application id.
  5799  //	int64 start The start instant as UTC milliseconds since Epoch.
  5800  //	int64 end The end instant as UTC milliseconds since Epoch.
  5801  func (c *FusionAuthClient) RetrieveLoginReportWithContext(ctx context.Context, applicationId string, start int64, end int64) (*LoginReportResponse, *Errors, error) {
  5802  	var resp LoginReportResponse
  5803  	var errors Errors
  5804  
  5805  	restClient := c.Start(&resp, &errors)
  5806  	err := restClient.WithUri("/api/report/login").
  5807  		WithParameter("applicationId", applicationId).
  5808  		WithParameter("start", strconv.FormatInt(start, 10)).
  5809  		WithParameter("end", strconv.FormatInt(end, 10)).
  5810  		WithMethod(http.MethodGet).
  5811  		Do(ctx)
  5812  	if restClient.ErrorRef == nil {
  5813  		return &resp, nil, err
  5814  	}
  5815  	return &resp, &errors, err
  5816  }
  5817  
  5818  // RetrieveMessageTemplate
  5819  // Retrieves the message template for the given Id. If you don't specify the id, this will return all the message templates.
  5820  //
  5821  //	string messageTemplateId (Optional) The Id of the message template.
  5822  func (c *FusionAuthClient) RetrieveMessageTemplate(messageTemplateId string) (*MessageTemplateResponse, error) {
  5823  	return c.RetrieveMessageTemplateWithContext(context.TODO(), messageTemplateId)
  5824  }
  5825  
  5826  // RetrieveMessageTemplateWithContext
  5827  // Retrieves the message template for the given Id. If you don't specify the id, this will return all the message templates.
  5828  //
  5829  //	string messageTemplateId (Optional) The Id of the message template.
  5830  func (c *FusionAuthClient) RetrieveMessageTemplateWithContext(ctx context.Context, messageTemplateId string) (*MessageTemplateResponse, error) {
  5831  	var resp MessageTemplateResponse
  5832  
  5833  	err := c.Start(&resp, nil).
  5834  		WithUri("/api/message/template").
  5835  		WithUriSegment(messageTemplateId).
  5836  		WithMethod(http.MethodGet).
  5837  		Do(ctx)
  5838  	return &resp, err
  5839  }
  5840  
  5841  // RetrieveMessageTemplatePreview
  5842  // Creates a preview of the message template provided in the request, normalized to a given locale.
  5843  //
  5844  //	PreviewMessageTemplateRequest request The request that contains the email template and optionally a locale to render it in.
  5845  func (c *FusionAuthClient) RetrieveMessageTemplatePreview(request PreviewMessageTemplateRequest) (*PreviewMessageTemplateResponse, *Errors, error) {
  5846  	return c.RetrieveMessageTemplatePreviewWithContext(context.TODO(), request)
  5847  }
  5848  
  5849  // RetrieveMessageTemplatePreviewWithContext
  5850  // Creates a preview of the message template provided in the request, normalized to a given locale.
  5851  //
  5852  //	PreviewMessageTemplateRequest request The request that contains the email template and optionally a locale to render it in.
  5853  func (c *FusionAuthClient) RetrieveMessageTemplatePreviewWithContext(ctx context.Context, request PreviewMessageTemplateRequest) (*PreviewMessageTemplateResponse, *Errors, error) {
  5854  	var resp PreviewMessageTemplateResponse
  5855  	var errors Errors
  5856  
  5857  	restClient := c.Start(&resp, &errors)
  5858  	err := restClient.WithUri("/api/message/template/preview").
  5859  		WithJSONBody(request).
  5860  		WithMethod(http.MethodPost).
  5861  		Do(ctx)
  5862  	if restClient.ErrorRef == nil {
  5863  		return &resp, nil, err
  5864  	}
  5865  	return &resp, &errors, err
  5866  }
  5867  
  5868  // RetrieveMessageTemplates
  5869  // Retrieves all the message templates.
  5870  func (c *FusionAuthClient) RetrieveMessageTemplates() (*MessageTemplateResponse, error) {
  5871  	return c.RetrieveMessageTemplatesWithContext(context.TODO())
  5872  }
  5873  
  5874  // RetrieveMessageTemplatesWithContext
  5875  // Retrieves all the message templates.
  5876  func (c *FusionAuthClient) RetrieveMessageTemplatesWithContext(ctx context.Context) (*MessageTemplateResponse, error) {
  5877  	var resp MessageTemplateResponse
  5878  
  5879  	err := c.Start(&resp, nil).
  5880  		WithUri("/api/message/template").
  5881  		WithMethod(http.MethodGet).
  5882  		Do(ctx)
  5883  	return &resp, err
  5884  }
  5885  
  5886  // RetrieveMessenger
  5887  // Retrieves the messenger with the given Id.
  5888  //
  5889  //	string messengerId The Id of the messenger.
  5890  func (c *FusionAuthClient) RetrieveMessenger(messengerId string) (*MessengerResponse, error) {
  5891  	return c.RetrieveMessengerWithContext(context.TODO(), messengerId)
  5892  }
  5893  
  5894  // RetrieveMessengerWithContext
  5895  // Retrieves the messenger with the given Id.
  5896  //
  5897  //	string messengerId The Id of the messenger.
  5898  func (c *FusionAuthClient) RetrieveMessengerWithContext(ctx context.Context, messengerId string) (*MessengerResponse, error) {
  5899  	var resp MessengerResponse
  5900  
  5901  	err := c.Start(&resp, nil).
  5902  		WithUri("/api/messenger").
  5903  		WithUriSegment(messengerId).
  5904  		WithMethod(http.MethodGet).
  5905  		Do(ctx)
  5906  	return &resp, err
  5907  }
  5908  
  5909  // RetrieveMessengers
  5910  // Retrieves all the messengers.
  5911  func (c *FusionAuthClient) RetrieveMessengers() (*MessengerResponse, error) {
  5912  	return c.RetrieveMessengersWithContext(context.TODO())
  5913  }
  5914  
  5915  // RetrieveMessengersWithContext
  5916  // Retrieves all the messengers.
  5917  func (c *FusionAuthClient) RetrieveMessengersWithContext(ctx context.Context) (*MessengerResponse, error) {
  5918  	var resp MessengerResponse
  5919  
  5920  	err := c.Start(&resp, nil).
  5921  		WithUri("/api/messenger").
  5922  		WithMethod(http.MethodGet).
  5923  		Do(ctx)
  5924  	return &resp, err
  5925  }
  5926  
  5927  // RetrieveMonthlyActiveReport
  5928  // Retrieves the monthly active user report between the two instants. If you specify an application id, it will only
  5929  // return the monthly active counts for that application.
  5930  //
  5931  //	string applicationId (Optional) The application id.
  5932  //	int64 start The start instant as UTC milliseconds since Epoch.
  5933  //	int64 end The end instant as UTC milliseconds since Epoch.
  5934  func (c *FusionAuthClient) RetrieveMonthlyActiveReport(applicationId string, start int64, end int64) (*MonthlyActiveUserReportResponse, *Errors, error) {
  5935  	return c.RetrieveMonthlyActiveReportWithContext(context.TODO(), applicationId, start, end)
  5936  }
  5937  
  5938  // RetrieveMonthlyActiveReportWithContext
  5939  // Retrieves the monthly active user report between the two instants. If you specify an application id, it will only
  5940  // return the monthly active counts for that application.
  5941  //
  5942  //	string applicationId (Optional) The application id.
  5943  //	int64 start The start instant as UTC milliseconds since Epoch.
  5944  //	int64 end The end instant as UTC milliseconds since Epoch.
  5945  func (c *FusionAuthClient) RetrieveMonthlyActiveReportWithContext(ctx context.Context, applicationId string, start int64, end int64) (*MonthlyActiveUserReportResponse, *Errors, error) {
  5946  	var resp MonthlyActiveUserReportResponse
  5947  	var errors Errors
  5948  
  5949  	restClient := c.Start(&resp, &errors)
  5950  	err := restClient.WithUri("/api/report/monthly-active-user").
  5951  		WithParameter("applicationId", applicationId).
  5952  		WithParameter("start", strconv.FormatInt(start, 10)).
  5953  		WithParameter("end", strconv.FormatInt(end, 10)).
  5954  		WithMethod(http.MethodGet).
  5955  		Do(ctx)
  5956  	if restClient.ErrorRef == nil {
  5957  		return &resp, nil, err
  5958  	}
  5959  	return &resp, &errors, err
  5960  }
  5961  
  5962  // RetrieveOAuthScope
  5963  // Retrieves a custom OAuth scope.
  5964  //
  5965  //	string applicationId The Id of the application that the OAuth scope belongs to.
  5966  //	string scopeId The Id of the OAuth scope to retrieve.
  5967  func (c *FusionAuthClient) RetrieveOAuthScope(applicationId string, scopeId string) (*ApplicationOAuthScopeResponse, *Errors, error) {
  5968  	return c.RetrieveOAuthScopeWithContext(context.TODO(), applicationId, scopeId)
  5969  }
  5970  
  5971  // RetrieveOAuthScopeWithContext
  5972  // Retrieves a custom OAuth scope.
  5973  //
  5974  //	string applicationId The Id of the application that the OAuth scope belongs to.
  5975  //	string scopeId The Id of the OAuth scope to retrieve.
  5976  func (c *FusionAuthClient) RetrieveOAuthScopeWithContext(ctx context.Context, applicationId string, scopeId string) (*ApplicationOAuthScopeResponse, *Errors, error) {
  5977  	var resp ApplicationOAuthScopeResponse
  5978  	var errors Errors
  5979  
  5980  	restClient := c.Start(&resp, &errors)
  5981  	err := restClient.WithUri("/api/application").
  5982  		WithUriSegment(applicationId).
  5983  		WithUriSegment("scope").
  5984  		WithUriSegment(scopeId).
  5985  		WithMethod(http.MethodGet).
  5986  		Do(ctx)
  5987  	if restClient.ErrorRef == nil {
  5988  		return &resp, nil, err
  5989  	}
  5990  	return &resp, &errors, err
  5991  }
  5992  
  5993  // RetrieveOauthConfiguration
  5994  // Retrieves the Oauth2 configuration for the application for the given Application Id.
  5995  //
  5996  //	string applicationId The Id of the Application to retrieve OAuth configuration.
  5997  func (c *FusionAuthClient) RetrieveOauthConfiguration(applicationId string) (*OAuthConfigurationResponse, *Errors, error) {
  5998  	return c.RetrieveOauthConfigurationWithContext(context.TODO(), applicationId)
  5999  }
  6000  
  6001  // RetrieveOauthConfigurationWithContext
  6002  // Retrieves the Oauth2 configuration for the application for the given Application Id.
  6003  //
  6004  //	string applicationId The Id of the Application to retrieve OAuth configuration.
  6005  func (c *FusionAuthClient) RetrieveOauthConfigurationWithContext(ctx context.Context, applicationId string) (*OAuthConfigurationResponse, *Errors, error) {
  6006  	var resp OAuthConfigurationResponse
  6007  	var errors Errors
  6008  
  6009  	restClient := c.Start(&resp, &errors)
  6010  	err := restClient.WithUri("/api/application").
  6011  		WithUriSegment(applicationId).
  6012  		WithUriSegment("oauth-configuration").
  6013  		WithMethod(http.MethodGet).
  6014  		Do(ctx)
  6015  	if restClient.ErrorRef == nil {
  6016  		return &resp, nil, err
  6017  	}
  6018  	return &resp, &errors, err
  6019  }
  6020  
  6021  // RetrieveOpenIdConfiguration
  6022  // Returns the well known OpenID Configuration JSON document
  6023  func (c *FusionAuthClient) RetrieveOpenIdConfiguration() (*OpenIdConfiguration, error) {
  6024  	return c.RetrieveOpenIdConfigurationWithContext(context.TODO())
  6025  }
  6026  
  6027  // RetrieveOpenIdConfigurationWithContext
  6028  // Returns the well known OpenID Configuration JSON document
  6029  func (c *FusionAuthClient) RetrieveOpenIdConfigurationWithContext(ctx context.Context) (*OpenIdConfiguration, error) {
  6030  	var resp OpenIdConfiguration
  6031  
  6032  	err := c.StartAnonymous(&resp, nil).
  6033  		WithUri("/.well-known/openid-configuration").
  6034  		WithMethod(http.MethodGet).
  6035  		Do(ctx)
  6036  	return &resp, err
  6037  }
  6038  
  6039  // RetrievePasswordValidationRules
  6040  // Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided
  6041  // through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.
  6042  //
  6043  // This API does not require an API key.
  6044  func (c *FusionAuthClient) RetrievePasswordValidationRules() (*PasswordValidationRulesResponse, error) {
  6045  	return c.RetrievePasswordValidationRulesWithContext(context.TODO())
  6046  }
  6047  
  6048  // RetrievePasswordValidationRulesWithContext
  6049  // Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided
  6050  // through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.
  6051  //
  6052  // This API does not require an API key.
  6053  func (c *FusionAuthClient) RetrievePasswordValidationRulesWithContext(ctx context.Context) (*PasswordValidationRulesResponse, error) {
  6054  	var resp PasswordValidationRulesResponse
  6055  
  6056  	err := c.StartAnonymous(&resp, nil).
  6057  		WithUri("/api/tenant/password-validation-rules").
  6058  		WithMethod(http.MethodGet).
  6059  		Do(ctx)
  6060  	return &resp, err
  6061  }
  6062  
  6063  // RetrievePasswordValidationRulesWithTenantId
  6064  // Retrieves the password validation rules for a specific tenant.
  6065  //
  6066  // This API does not require an API key.
  6067  //
  6068  //	string tenantId The Id of the tenant.
  6069  func (c *FusionAuthClient) RetrievePasswordValidationRulesWithTenantId(tenantId string) (*PasswordValidationRulesResponse, error) {
  6070  	return c.RetrievePasswordValidationRulesWithTenantIdWithContext(context.TODO(), tenantId)
  6071  }
  6072  
  6073  // RetrievePasswordValidationRulesWithTenantIdWithContext
  6074  // Retrieves the password validation rules for a specific tenant.
  6075  //
  6076  // This API does not require an API key.
  6077  //
  6078  //	string tenantId The Id of the tenant.
  6079  func (c *FusionAuthClient) RetrievePasswordValidationRulesWithTenantIdWithContext(ctx context.Context, tenantId string) (*PasswordValidationRulesResponse, error) {
  6080  	var resp PasswordValidationRulesResponse
  6081  
  6082  	err := c.StartAnonymous(&resp, nil).
  6083  		WithUri("/api/tenant/password-validation-rules").
  6084  		WithUriSegment(tenantId).
  6085  		WithMethod(http.MethodGet).
  6086  		Do(ctx)
  6087  	return &resp, err
  6088  }
  6089  
  6090  // RetrievePendingChildren
  6091  // Retrieves all the children for the given parent email address.
  6092  //
  6093  //	string parentEmail The email of the parent.
  6094  func (c *FusionAuthClient) RetrievePendingChildren(parentEmail string) (*PendingResponse, *Errors, error) {
  6095  	return c.RetrievePendingChildrenWithContext(context.TODO(), parentEmail)
  6096  }
  6097  
  6098  // RetrievePendingChildrenWithContext
  6099  // Retrieves all the children for the given parent email address.
  6100  //
  6101  //	string parentEmail The email of the parent.
  6102  func (c *FusionAuthClient) RetrievePendingChildrenWithContext(ctx context.Context, parentEmail string) (*PendingResponse, *Errors, error) {
  6103  	var resp PendingResponse
  6104  	var errors Errors
  6105  
  6106  	restClient := c.Start(&resp, &errors)
  6107  	err := restClient.WithUri("/api/user/family/pending").
  6108  		WithParameter("parentEmail", parentEmail).
  6109  		WithMethod(http.MethodGet).
  6110  		Do(ctx)
  6111  	if restClient.ErrorRef == nil {
  6112  		return &resp, nil, err
  6113  	}
  6114  	return &resp, &errors, err
  6115  }
  6116  
  6117  // RetrievePendingLink
  6118  // Retrieve a pending identity provider link. This is useful to validate a pending link and retrieve meta-data about the identity provider link.
  6119  //
  6120  //	string pendingLinkId The pending link Id.
  6121  //	string userId The optional userId. When provided additional meta-data will be provided to identify how many links if any the user already has.
  6122  func (c *FusionAuthClient) RetrievePendingLink(pendingLinkId string, userId string) (*IdentityProviderPendingLinkResponse, *Errors, error) {
  6123  	return c.RetrievePendingLinkWithContext(context.TODO(), pendingLinkId, userId)
  6124  }
  6125  
  6126  // RetrievePendingLinkWithContext
  6127  // Retrieve a pending identity provider link. This is useful to validate a pending link and retrieve meta-data about the identity provider link.
  6128  //
  6129  //	string pendingLinkId The pending link Id.
  6130  //	string userId The optional userId. When provided additional meta-data will be provided to identify how many links if any the user already has.
  6131  func (c *FusionAuthClient) RetrievePendingLinkWithContext(ctx context.Context, pendingLinkId string, userId string) (*IdentityProviderPendingLinkResponse, *Errors, error) {
  6132  	var resp IdentityProviderPendingLinkResponse
  6133  	var errors Errors
  6134  
  6135  	restClient := c.Start(&resp, &errors)
  6136  	err := restClient.WithUri("/api/identity-provider/link/pending").
  6137  		WithUriSegment(pendingLinkId).
  6138  		WithParameter("userId", userId).
  6139  		WithMethod(http.MethodGet).
  6140  		Do(ctx)
  6141  	if restClient.ErrorRef == nil {
  6142  		return &resp, nil, err
  6143  	}
  6144  	return &resp, &errors, err
  6145  }
  6146  
  6147  // RetrieveReactorMetrics
  6148  // Retrieves the FusionAuth Reactor metrics.
  6149  func (c *FusionAuthClient) RetrieveReactorMetrics() (*ReactorMetricsResponse, error) {
  6150  	return c.RetrieveReactorMetricsWithContext(context.TODO())
  6151  }
  6152  
  6153  // RetrieveReactorMetricsWithContext
  6154  // Retrieves the FusionAuth Reactor metrics.
  6155  func (c *FusionAuthClient) RetrieveReactorMetricsWithContext(ctx context.Context) (*ReactorMetricsResponse, error) {
  6156  	var resp ReactorMetricsResponse
  6157  
  6158  	err := c.Start(&resp, nil).
  6159  		WithUri("/api/reactor/metrics").
  6160  		WithMethod(http.MethodGet).
  6161  		Do(ctx)
  6162  	return &resp, err
  6163  }
  6164  
  6165  // RetrieveReactorStatus
  6166  // Retrieves the FusionAuth Reactor status.
  6167  func (c *FusionAuthClient) RetrieveReactorStatus() (*ReactorResponse, error) {
  6168  	return c.RetrieveReactorStatusWithContext(context.TODO())
  6169  }
  6170  
  6171  // RetrieveReactorStatusWithContext
  6172  // Retrieves the FusionAuth Reactor status.
  6173  func (c *FusionAuthClient) RetrieveReactorStatusWithContext(ctx context.Context) (*ReactorResponse, error) {
  6174  	var resp ReactorResponse
  6175  
  6176  	err := c.Start(&resp, nil).
  6177  		WithUri("/api/reactor").
  6178  		WithMethod(http.MethodGet).
  6179  		Do(ctx)
  6180  	return &resp, err
  6181  }
  6182  
  6183  // RetrieveRecentLogins
  6184  // Retrieves the last number of login records.
  6185  //
  6186  //	int offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.
  6187  //	int limit (Optional, defaults to 10) The number of records to retrieve.
  6188  func (c *FusionAuthClient) RetrieveRecentLogins(offset int, limit int) (*RecentLoginResponse, *Errors, error) {
  6189  	return c.RetrieveRecentLoginsWithContext(context.TODO(), offset, limit)
  6190  }
  6191  
  6192  // RetrieveRecentLoginsWithContext
  6193  // Retrieves the last number of login records.
  6194  //
  6195  //	int offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.
  6196  //	int limit (Optional, defaults to 10) The number of records to retrieve.
  6197  func (c *FusionAuthClient) RetrieveRecentLoginsWithContext(ctx context.Context, offset int, limit int) (*RecentLoginResponse, *Errors, error) {
  6198  	var resp RecentLoginResponse
  6199  	var errors Errors
  6200  
  6201  	restClient := c.Start(&resp, &errors)
  6202  	err := restClient.WithUri("/api/user/recent-login").
  6203  		WithParameter("offset", strconv.Itoa(offset)).
  6204  		WithParameter("limit", strconv.Itoa(limit)).
  6205  		WithMethod(http.MethodGet).
  6206  		Do(ctx)
  6207  	if restClient.ErrorRef == nil {
  6208  		return &resp, nil, err
  6209  	}
  6210  	return &resp, &errors, err
  6211  }
  6212  
  6213  // RetrieveRefreshTokenById
  6214  // Retrieves a single refresh token by unique Id. This is not the same thing as the string value of the refresh token. If you have that, you already have what you need.
  6215  //
  6216  //	string tokenId The Id of the token.
  6217  func (c *FusionAuthClient) RetrieveRefreshTokenById(tokenId string) (*RefreshTokenResponse, *Errors, error) {
  6218  	return c.RetrieveRefreshTokenByIdWithContext(context.TODO(), tokenId)
  6219  }
  6220  
  6221  // RetrieveRefreshTokenByIdWithContext
  6222  // Retrieves a single refresh token by unique Id. This is not the same thing as the string value of the refresh token. If you have that, you already have what you need.
  6223  //
  6224  //	string tokenId The Id of the token.
  6225  func (c *FusionAuthClient) RetrieveRefreshTokenByIdWithContext(ctx context.Context, tokenId string) (*RefreshTokenResponse, *Errors, error) {
  6226  	var resp RefreshTokenResponse
  6227  	var errors Errors
  6228  
  6229  	restClient := c.Start(&resp, &errors)
  6230  	err := restClient.WithUri("/api/jwt/refresh").
  6231  		WithUriSegment(tokenId).
  6232  		WithMethod(http.MethodGet).
  6233  		Do(ctx)
  6234  	if restClient.ErrorRef == nil {
  6235  		return &resp, nil, err
  6236  	}
  6237  	return &resp, &errors, err
  6238  }
  6239  
  6240  // RetrieveRefreshTokens
  6241  // Retrieves the refresh tokens that belong to the user with the given Id.
  6242  //
  6243  //	string userId The Id of the user.
  6244  func (c *FusionAuthClient) RetrieveRefreshTokens(userId string) (*RefreshTokenResponse, *Errors, error) {
  6245  	return c.RetrieveRefreshTokensWithContext(context.TODO(), userId)
  6246  }
  6247  
  6248  // RetrieveRefreshTokensWithContext
  6249  // Retrieves the refresh tokens that belong to the user with the given Id.
  6250  //
  6251  //	string userId The Id of the user.
  6252  func (c *FusionAuthClient) RetrieveRefreshTokensWithContext(ctx context.Context, userId string) (*RefreshTokenResponse, *Errors, error) {
  6253  	var resp RefreshTokenResponse
  6254  	var errors Errors
  6255  
  6256  	restClient := c.Start(&resp, &errors)
  6257  	err := restClient.WithUri("/api/jwt/refresh").
  6258  		WithParameter("userId", userId).
  6259  		WithMethod(http.MethodGet).
  6260  		Do(ctx)
  6261  	if restClient.ErrorRef == nil {
  6262  		return &resp, nil, err
  6263  	}
  6264  	return &resp, &errors, err
  6265  }
  6266  
  6267  // RetrieveRegistration
  6268  // Retrieves the user registration for the user with the given Id and the given application id.
  6269  //
  6270  //	string userId The Id of the user.
  6271  //	string applicationId The Id of the application.
  6272  func (c *FusionAuthClient) RetrieveRegistration(userId string, applicationId string) (*RegistrationResponse, *Errors, error) {
  6273  	return c.RetrieveRegistrationWithContext(context.TODO(), userId, applicationId)
  6274  }
  6275  
  6276  // RetrieveRegistrationWithContext
  6277  // Retrieves the user registration for the user with the given Id and the given application id.
  6278  //
  6279  //	string userId The Id of the user.
  6280  //	string applicationId The Id of the application.
  6281  func (c *FusionAuthClient) RetrieveRegistrationWithContext(ctx context.Context, userId string, applicationId string) (*RegistrationResponse, *Errors, error) {
  6282  	var resp RegistrationResponse
  6283  	var errors Errors
  6284  
  6285  	restClient := c.Start(&resp, &errors)
  6286  	err := restClient.WithUri("/api/user/registration").
  6287  		WithUriSegment(userId).
  6288  		WithUriSegment(applicationId).
  6289  		WithMethod(http.MethodGet).
  6290  		Do(ctx)
  6291  	if restClient.ErrorRef == nil {
  6292  		return &resp, nil, err
  6293  	}
  6294  	return &resp, &errors, err
  6295  }
  6296  
  6297  // RetrieveRegistrationReport
  6298  // Retrieves the registration report between the two instants. If you specify an application id, it will only return
  6299  // the registration counts for that application.
  6300  //
  6301  //	string applicationId (Optional) The application id.
  6302  //	int64 start The start instant as UTC milliseconds since Epoch.
  6303  //	int64 end The end instant as UTC milliseconds since Epoch.
  6304  func (c *FusionAuthClient) RetrieveRegistrationReport(applicationId string, start int64, end int64) (*RegistrationReportResponse, *Errors, error) {
  6305  	return c.RetrieveRegistrationReportWithContext(context.TODO(), applicationId, start, end)
  6306  }
  6307  
  6308  // RetrieveRegistrationReportWithContext
  6309  // Retrieves the registration report between the two instants. If you specify an application id, it will only return
  6310  // the registration counts for that application.
  6311  //
  6312  //	string applicationId (Optional) The application id.
  6313  //	int64 start The start instant as UTC milliseconds since Epoch.
  6314  //	int64 end The end instant as UTC milliseconds since Epoch.
  6315  func (c *FusionAuthClient) RetrieveRegistrationReportWithContext(ctx context.Context, applicationId string, start int64, end int64) (*RegistrationReportResponse, *Errors, error) {
  6316  	var resp RegistrationReportResponse
  6317  	var errors Errors
  6318  
  6319  	restClient := c.Start(&resp, &errors)
  6320  	err := restClient.WithUri("/api/report/registration").
  6321  		WithParameter("applicationId", applicationId).
  6322  		WithParameter("start", strconv.FormatInt(start, 10)).
  6323  		WithParameter("end", strconv.FormatInt(end, 10)).
  6324  		WithMethod(http.MethodGet).
  6325  		Do(ctx)
  6326  	if restClient.ErrorRef == nil {
  6327  		return &resp, nil, err
  6328  	}
  6329  	return &resp, &errors, err
  6330  }
  6331  
  6332  // RetrieveReindexStatus
  6333  // Retrieve the status of a re-index process. A status code of 200 indicates the re-index is in progress, a status code of
  6334  // 404 indicates no re-index is in progress.
  6335  func (c *FusionAuthClient) RetrieveReindexStatus() (*BaseHTTPResponse, *Errors, error) {
  6336  	return c.RetrieveReindexStatusWithContext(context.TODO())
  6337  }
  6338  
  6339  // RetrieveReindexStatusWithContext
  6340  // Retrieve the status of a re-index process. A status code of 200 indicates the re-index is in progress, a status code of
  6341  // 404 indicates no re-index is in progress.
  6342  func (c *FusionAuthClient) RetrieveReindexStatusWithContext(ctx context.Context) (*BaseHTTPResponse, *Errors, error) {
  6343  	var resp BaseHTTPResponse
  6344  	var errors Errors
  6345  
  6346  	restClient := c.Start(&resp, &errors)
  6347  	err := restClient.WithUri("/api/system/reindex").
  6348  		WithMethod(http.MethodGet).
  6349  		Do(ctx)
  6350  	if restClient.ErrorRef == nil {
  6351  		return &resp, nil, err
  6352  	}
  6353  	return &resp, &errors, err
  6354  }
  6355  
  6356  // RetrieveSystemConfiguration
  6357  // Retrieves the system configuration.
  6358  func (c *FusionAuthClient) RetrieveSystemConfiguration() (*SystemConfigurationResponse, error) {
  6359  	return c.RetrieveSystemConfigurationWithContext(context.TODO())
  6360  }
  6361  
  6362  // RetrieveSystemConfigurationWithContext
  6363  // Retrieves the system configuration.
  6364  func (c *FusionAuthClient) RetrieveSystemConfigurationWithContext(ctx context.Context) (*SystemConfigurationResponse, error) {
  6365  	var resp SystemConfigurationResponse
  6366  
  6367  	err := c.Start(&resp, nil).
  6368  		WithUri("/api/system-configuration").
  6369  		WithMethod(http.MethodGet).
  6370  		Do(ctx)
  6371  	return &resp, err
  6372  }
  6373  
  6374  // RetrieveTenant
  6375  // Retrieves the tenant for the given Id.
  6376  //
  6377  //	string tenantId The Id of the tenant.
  6378  func (c *FusionAuthClient) RetrieveTenant(tenantId string) (*TenantResponse, *Errors, error) {
  6379  	return c.RetrieveTenantWithContext(context.TODO(), tenantId)
  6380  }
  6381  
  6382  // RetrieveTenantWithContext
  6383  // Retrieves the tenant for the given Id.
  6384  //
  6385  //	string tenantId The Id of the tenant.
  6386  func (c *FusionAuthClient) RetrieveTenantWithContext(ctx context.Context, tenantId string) (*TenantResponse, *Errors, error) {
  6387  	var resp TenantResponse
  6388  	var errors Errors
  6389  
  6390  	restClient := c.Start(&resp, &errors)
  6391  	err := restClient.WithUri("/api/tenant").
  6392  		WithUriSegment(tenantId).
  6393  		WithMethod(http.MethodGet).
  6394  		Do(ctx)
  6395  	if restClient.ErrorRef == nil {
  6396  		return &resp, nil, err
  6397  	}
  6398  	return &resp, &errors, err
  6399  }
  6400  
  6401  // RetrieveTenants
  6402  // Retrieves all the tenants.
  6403  func (c *FusionAuthClient) RetrieveTenants() (*TenantResponse, error) {
  6404  	return c.RetrieveTenantsWithContext(context.TODO())
  6405  }
  6406  
  6407  // RetrieveTenantsWithContext
  6408  // Retrieves all the tenants.
  6409  func (c *FusionAuthClient) RetrieveTenantsWithContext(ctx context.Context) (*TenantResponse, error) {
  6410  	var resp TenantResponse
  6411  
  6412  	err := c.Start(&resp, nil).
  6413  		WithUri("/api/tenant").
  6414  		WithMethod(http.MethodGet).
  6415  		Do(ctx)
  6416  	return &resp, err
  6417  }
  6418  
  6419  // RetrieveTheme
  6420  // Retrieves the theme for the given Id.
  6421  //
  6422  //	string themeId The Id of the theme.
  6423  func (c *FusionAuthClient) RetrieveTheme(themeId string) (*ThemeResponse, *Errors, error) {
  6424  	return c.RetrieveThemeWithContext(context.TODO(), themeId)
  6425  }
  6426  
  6427  // RetrieveThemeWithContext
  6428  // Retrieves the theme for the given Id.
  6429  //
  6430  //	string themeId The Id of the theme.
  6431  func (c *FusionAuthClient) RetrieveThemeWithContext(ctx context.Context, themeId string) (*ThemeResponse, *Errors, error) {
  6432  	var resp ThemeResponse
  6433  	var errors Errors
  6434  
  6435  	restClient := c.Start(&resp, &errors)
  6436  	err := restClient.WithUri("/api/theme").
  6437  		WithUriSegment(themeId).
  6438  		WithMethod(http.MethodGet).
  6439  		Do(ctx)
  6440  	if restClient.ErrorRef == nil {
  6441  		return &resp, nil, err
  6442  	}
  6443  	return &resp, &errors, err
  6444  }
  6445  
  6446  // RetrieveThemes
  6447  // Retrieves all the themes.
  6448  func (c *FusionAuthClient) RetrieveThemes() (*ThemeResponse, error) {
  6449  	return c.RetrieveThemesWithContext(context.TODO())
  6450  }
  6451  
  6452  // RetrieveThemesWithContext
  6453  // Retrieves all the themes.
  6454  func (c *FusionAuthClient) RetrieveThemesWithContext(ctx context.Context) (*ThemeResponse, error) {
  6455  	var resp ThemeResponse
  6456  
  6457  	err := c.Start(&resp, nil).
  6458  		WithUri("/api/theme").
  6459  		WithMethod(http.MethodGet).
  6460  		Do(ctx)
  6461  	return &resp, err
  6462  }
  6463  
  6464  // RetrieveTotalReport
  6465  // Retrieves the totals report. This contains all the total counts for each application and the global registration
  6466  // count.
  6467  func (c *FusionAuthClient) RetrieveTotalReport() (*TotalsReportResponse, error) {
  6468  	return c.RetrieveTotalReportWithContext(context.TODO())
  6469  }
  6470  
  6471  // RetrieveTotalReportWithContext
  6472  // Retrieves the totals report. This contains all the total counts for each application and the global registration
  6473  // count.
  6474  func (c *FusionAuthClient) RetrieveTotalReportWithContext(ctx context.Context) (*TotalsReportResponse, error) {
  6475  	var resp TotalsReportResponse
  6476  
  6477  	err := c.Start(&resp, nil).
  6478  		WithUri("/api/report/totals").
  6479  		WithMethod(http.MethodGet).
  6480  		Do(ctx)
  6481  	return &resp, err
  6482  }
  6483  
  6484  // RetrieveTwoFactorRecoveryCodes
  6485  // Retrieve two-factor recovery codes for a user.
  6486  //
  6487  //	string userId The Id of the user to retrieve Two Factor recovery codes.
  6488  func (c *FusionAuthClient) RetrieveTwoFactorRecoveryCodes(userId string) (*TwoFactorRecoveryCodeResponse, *Errors, error) {
  6489  	return c.RetrieveTwoFactorRecoveryCodesWithContext(context.TODO(), userId)
  6490  }
  6491  
  6492  // RetrieveTwoFactorRecoveryCodesWithContext
  6493  // Retrieve two-factor recovery codes for a user.
  6494  //
  6495  //	string userId The Id of the user to retrieve Two Factor recovery codes.
  6496  func (c *FusionAuthClient) RetrieveTwoFactorRecoveryCodesWithContext(ctx context.Context, userId string) (*TwoFactorRecoveryCodeResponse, *Errors, error) {
  6497  	var resp TwoFactorRecoveryCodeResponse
  6498  	var errors Errors
  6499  
  6500  	restClient := c.Start(&resp, &errors)
  6501  	err := restClient.WithUri("/api/user/two-factor/recovery-code").
  6502  		WithUriSegment(userId).
  6503  		WithMethod(http.MethodGet).
  6504  		Do(ctx)
  6505  	if restClient.ErrorRef == nil {
  6506  		return &resp, nil, err
  6507  	}
  6508  	return &resp, &errors, err
  6509  }
  6510  
  6511  // RetrieveTwoFactorStatus
  6512  // Retrieve a user's two-factor status.
  6513  //
  6514  // This can be used to see if a user will need to complete a two-factor challenge to complete a login,
  6515  // and optionally identify the state of the two-factor trust across various applications.
  6516  //
  6517  //	string userId The user Id to retrieve the Two-Factor status.
  6518  //	string applicationId The optional applicationId to verify.
  6519  //	string twoFactorTrustId The optional two-factor trust Id to verify.
  6520  func (c *FusionAuthClient) RetrieveTwoFactorStatus(userId string, applicationId string, twoFactorTrustId string) (*TwoFactorStatusResponse, *Errors, error) {
  6521  	return c.RetrieveTwoFactorStatusWithContext(context.TODO(), userId, applicationId, twoFactorTrustId)
  6522  }
  6523  
  6524  // RetrieveTwoFactorStatusWithContext
  6525  // Retrieve a user's two-factor status.
  6526  //
  6527  // This can be used to see if a user will need to complete a two-factor challenge to complete a login,
  6528  // and optionally identify the state of the two-factor trust across various applications.
  6529  //
  6530  //	string userId The user Id to retrieve the Two-Factor status.
  6531  //	string applicationId The optional applicationId to verify.
  6532  //	string twoFactorTrustId The optional two-factor trust Id to verify.
  6533  func (c *FusionAuthClient) RetrieveTwoFactorStatusWithContext(ctx context.Context, userId string, applicationId string, twoFactorTrustId string) (*TwoFactorStatusResponse, *Errors, error) {
  6534  	var resp TwoFactorStatusResponse
  6535  	var errors Errors
  6536  
  6537  	restClient := c.Start(&resp, &errors)
  6538  	err := restClient.WithUri("/api/two-factor/status").
  6539  		WithParameter("userId", userId).
  6540  		WithParameter("applicationId", applicationId).
  6541  		WithUriSegment(twoFactorTrustId).
  6542  		WithMethod(http.MethodGet).
  6543  		Do(ctx)
  6544  	if restClient.ErrorRef == nil {
  6545  		return &resp, nil, err
  6546  	}
  6547  	return &resp, &errors, err
  6548  }
  6549  
  6550  // RetrieveUser
  6551  // Retrieves the user for the given Id.
  6552  //
  6553  //	string userId The Id of the user.
  6554  func (c *FusionAuthClient) RetrieveUser(userId string) (*UserResponse, *Errors, error) {
  6555  	return c.RetrieveUserWithContext(context.TODO(), userId)
  6556  }
  6557  
  6558  // RetrieveUserWithContext
  6559  // Retrieves the user for the given Id.
  6560  //
  6561  //	string userId The Id of the user.
  6562  func (c *FusionAuthClient) RetrieveUserWithContext(ctx context.Context, userId string) (*UserResponse, *Errors, error) {
  6563  	var resp UserResponse
  6564  	var errors Errors
  6565  
  6566  	restClient := c.Start(&resp, &errors)
  6567  	err := restClient.WithUri("/api/user").
  6568  		WithUriSegment(userId).
  6569  		WithMethod(http.MethodGet).
  6570  		Do(ctx)
  6571  	if restClient.ErrorRef == nil {
  6572  		return &resp, nil, err
  6573  	}
  6574  	return &resp, &errors, err
  6575  }
  6576  
  6577  // RetrieveUserAction
  6578  // Retrieves the user action for the given Id. If you pass in null for the id, this will return all the user
  6579  // actions.
  6580  //
  6581  //	string userActionId (Optional) The Id of the user action.
  6582  func (c *FusionAuthClient) RetrieveUserAction(userActionId string) (*UserActionResponse, error) {
  6583  	return c.RetrieveUserActionWithContext(context.TODO(), userActionId)
  6584  }
  6585  
  6586  // RetrieveUserActionWithContext
  6587  // Retrieves the user action for the given Id. If you pass in null for the id, this will return all the user
  6588  // actions.
  6589  //
  6590  //	string userActionId (Optional) The Id of the user action.
  6591  func (c *FusionAuthClient) RetrieveUserActionWithContext(ctx context.Context, userActionId string) (*UserActionResponse, error) {
  6592  	var resp UserActionResponse
  6593  
  6594  	err := c.Start(&resp, nil).
  6595  		WithUri("/api/user-action").
  6596  		WithUriSegment(userActionId).
  6597  		WithMethod(http.MethodGet).
  6598  		Do(ctx)
  6599  	return &resp, err
  6600  }
  6601  
  6602  // RetrieveUserActionReason
  6603  // Retrieves the user action reason for the given Id. If you pass in null for the id, this will return all the user
  6604  // action reasons.
  6605  //
  6606  //	string userActionReasonId (Optional) The Id of the user action reason.
  6607  func (c *FusionAuthClient) RetrieveUserActionReason(userActionReasonId string) (*UserActionReasonResponse, error) {
  6608  	return c.RetrieveUserActionReasonWithContext(context.TODO(), userActionReasonId)
  6609  }
  6610  
  6611  // RetrieveUserActionReasonWithContext
  6612  // Retrieves the user action reason for the given Id. If you pass in null for the id, this will return all the user
  6613  // action reasons.
  6614  //
  6615  //	string userActionReasonId (Optional) The Id of the user action reason.
  6616  func (c *FusionAuthClient) RetrieveUserActionReasonWithContext(ctx context.Context, userActionReasonId string) (*UserActionReasonResponse, error) {
  6617  	var resp UserActionReasonResponse
  6618  
  6619  	err := c.Start(&resp, nil).
  6620  		WithUri("/api/user-action-reason").
  6621  		WithUriSegment(userActionReasonId).
  6622  		WithMethod(http.MethodGet).
  6623  		Do(ctx)
  6624  	return &resp, err
  6625  }
  6626  
  6627  // RetrieveUserActionReasons
  6628  // Retrieves all the user action reasons.
  6629  func (c *FusionAuthClient) RetrieveUserActionReasons() (*UserActionReasonResponse, error) {
  6630  	return c.RetrieveUserActionReasonsWithContext(context.TODO())
  6631  }
  6632  
  6633  // RetrieveUserActionReasonsWithContext
  6634  // Retrieves all the user action reasons.
  6635  func (c *FusionAuthClient) RetrieveUserActionReasonsWithContext(ctx context.Context) (*UserActionReasonResponse, error) {
  6636  	var resp UserActionReasonResponse
  6637  
  6638  	err := c.Start(&resp, nil).
  6639  		WithUri("/api/user-action-reason").
  6640  		WithMethod(http.MethodGet).
  6641  		Do(ctx)
  6642  	return &resp, err
  6643  }
  6644  
  6645  // RetrieveUserActions
  6646  // Retrieves all the user actions.
  6647  func (c *FusionAuthClient) RetrieveUserActions() (*UserActionResponse, error) {
  6648  	return c.RetrieveUserActionsWithContext(context.TODO())
  6649  }
  6650  
  6651  // RetrieveUserActionsWithContext
  6652  // Retrieves all the user actions.
  6653  func (c *FusionAuthClient) RetrieveUserActionsWithContext(ctx context.Context) (*UserActionResponse, error) {
  6654  	var resp UserActionResponse
  6655  
  6656  	err := c.Start(&resp, nil).
  6657  		WithUri("/api/user-action").
  6658  		WithMethod(http.MethodGet).
  6659  		Do(ctx)
  6660  	return &resp, err
  6661  }
  6662  
  6663  // RetrieveUserByChangePasswordId
  6664  // Retrieves the user by a change password Id. The intended use of this API is to retrieve a user after the forgot
  6665  // password workflow has been initiated and you may not know the user's email or username.
  6666  //
  6667  //	string changePasswordId The unique change password Id that was sent via email or returned by the Forgot Password API.
  6668  func (c *FusionAuthClient) RetrieveUserByChangePasswordId(changePasswordId string) (*UserResponse, *Errors, error) {
  6669  	return c.RetrieveUserByChangePasswordIdWithContext(context.TODO(), changePasswordId)
  6670  }
  6671  
  6672  // RetrieveUserByChangePasswordIdWithContext
  6673  // Retrieves the user by a change password Id. The intended use of this API is to retrieve a user after the forgot
  6674  // password workflow has been initiated and you may not know the user's email or username.
  6675  //
  6676  //	string changePasswordId The unique change password Id that was sent via email or returned by the Forgot Password API.
  6677  func (c *FusionAuthClient) RetrieveUserByChangePasswordIdWithContext(ctx context.Context, changePasswordId string) (*UserResponse, *Errors, error) {
  6678  	var resp UserResponse
  6679  	var errors Errors
  6680  
  6681  	restClient := c.Start(&resp, &errors)
  6682  	err := restClient.WithUri("/api/user").
  6683  		WithParameter("changePasswordId", changePasswordId).
  6684  		WithMethod(http.MethodGet).
  6685  		Do(ctx)
  6686  	if restClient.ErrorRef == nil {
  6687  		return &resp, nil, err
  6688  	}
  6689  	return &resp, &errors, err
  6690  }
  6691  
  6692  // RetrieveUserByEmail
  6693  // Retrieves the user for the given email.
  6694  //
  6695  //	string email The email of the user.
  6696  func (c *FusionAuthClient) RetrieveUserByEmail(email string) (*UserResponse, *Errors, error) {
  6697  	return c.RetrieveUserByEmailWithContext(context.TODO(), email)
  6698  }
  6699  
  6700  // RetrieveUserByEmailWithContext
  6701  // Retrieves the user for the given email.
  6702  //
  6703  //	string email The email of the user.
  6704  func (c *FusionAuthClient) RetrieveUserByEmailWithContext(ctx context.Context, email string) (*UserResponse, *Errors, error) {
  6705  	var resp UserResponse
  6706  	var errors Errors
  6707  
  6708  	restClient := c.Start(&resp, &errors)
  6709  	err := restClient.WithUri("/api/user").
  6710  		WithParameter("email", email).
  6711  		WithMethod(http.MethodGet).
  6712  		Do(ctx)
  6713  	if restClient.ErrorRef == nil {
  6714  		return &resp, nil, err
  6715  	}
  6716  	return &resp, &errors, err
  6717  }
  6718  
  6719  // RetrieveUserByLoginId
  6720  // Retrieves the user for the loginId. The loginId can be either the username or the email.
  6721  //
  6722  //	string loginId The email or username of the user.
  6723  func (c *FusionAuthClient) RetrieveUserByLoginId(loginId string) (*UserResponse, *Errors, error) {
  6724  	return c.RetrieveUserByLoginIdWithContext(context.TODO(), loginId)
  6725  }
  6726  
  6727  // RetrieveUserByLoginIdWithContext
  6728  // Retrieves the user for the loginId. The loginId can be either the username or the email.
  6729  //
  6730  //	string loginId The email or username of the user.
  6731  func (c *FusionAuthClient) RetrieveUserByLoginIdWithContext(ctx context.Context, loginId string) (*UserResponse, *Errors, error) {
  6732  	var resp UserResponse
  6733  	var errors Errors
  6734  
  6735  	restClient := c.Start(&resp, &errors)
  6736  	err := restClient.WithUri("/api/user").
  6737  		WithParameter("loginId", loginId).
  6738  		WithMethod(http.MethodGet).
  6739  		Do(ctx)
  6740  	if restClient.ErrorRef == nil {
  6741  		return &resp, nil, err
  6742  	}
  6743  	return &resp, &errors, err
  6744  }
  6745  
  6746  // RetrieveUserByUsername
  6747  // Retrieves the user for the given username.
  6748  //
  6749  //	string username The username of the user.
  6750  func (c *FusionAuthClient) RetrieveUserByUsername(username string) (*UserResponse, *Errors, error) {
  6751  	return c.RetrieveUserByUsernameWithContext(context.TODO(), username)
  6752  }
  6753  
  6754  // RetrieveUserByUsernameWithContext
  6755  // Retrieves the user for the given username.
  6756  //
  6757  //	string username The username of the user.
  6758  func (c *FusionAuthClient) RetrieveUserByUsernameWithContext(ctx context.Context, username string) (*UserResponse, *Errors, error) {
  6759  	var resp UserResponse
  6760  	var errors Errors
  6761  
  6762  	restClient := c.Start(&resp, &errors)
  6763  	err := restClient.WithUri("/api/user").
  6764  		WithParameter("username", username).
  6765  		WithMethod(http.MethodGet).
  6766  		Do(ctx)
  6767  	if restClient.ErrorRef == nil {
  6768  		return &resp, nil, err
  6769  	}
  6770  	return &resp, &errors, err
  6771  }
  6772  
  6773  // RetrieveUserByVerificationId
  6774  // Retrieves the user by a verificationId. The intended use of this API is to retrieve a user after the forgot
  6775  // password workflow has been initiated and you may not know the user's email or username.
  6776  //
  6777  //	string verificationId The unique verification Id that has been set on the user object.
  6778  func (c *FusionAuthClient) RetrieveUserByVerificationId(verificationId string) (*UserResponse, *Errors, error) {
  6779  	return c.RetrieveUserByVerificationIdWithContext(context.TODO(), verificationId)
  6780  }
  6781  
  6782  // RetrieveUserByVerificationIdWithContext
  6783  // Retrieves the user by a verificationId. The intended use of this API is to retrieve a user after the forgot
  6784  // password workflow has been initiated and you may not know the user's email or username.
  6785  //
  6786  //	string verificationId The unique verification Id that has been set on the user object.
  6787  func (c *FusionAuthClient) RetrieveUserByVerificationIdWithContext(ctx context.Context, verificationId string) (*UserResponse, *Errors, error) {
  6788  	var resp UserResponse
  6789  	var errors Errors
  6790  
  6791  	restClient := c.Start(&resp, &errors)
  6792  	err := restClient.WithUri("/api/user").
  6793  		WithParameter("verificationId", verificationId).
  6794  		WithMethod(http.MethodGet).
  6795  		Do(ctx)
  6796  	if restClient.ErrorRef == nil {
  6797  		return &resp, nil, err
  6798  	}
  6799  	return &resp, &errors, err
  6800  }
  6801  
  6802  // RetrieveUserCode
  6803  // Retrieve a user_code that is part of an in-progress Device Authorization Grant.
  6804  //
  6805  // This API is useful if you want to build your own login workflow to complete a device grant.
  6806  //
  6807  //	string clientId The client id.
  6808  //	string clientSecret The client id.
  6809  //	string userCode The end-user verification code.
  6810  func (c *FusionAuthClient) RetrieveUserCode(clientId string, clientSecret string, userCode string) (*BaseHTTPResponse, error) {
  6811  	return c.RetrieveUserCodeWithContext(context.TODO(), clientId, clientSecret, userCode)
  6812  }
  6813  
  6814  // RetrieveUserCodeWithContext
  6815  // Retrieve a user_code that is part of an in-progress Device Authorization Grant.
  6816  //
  6817  // This API is useful if you want to build your own login workflow to complete a device grant.
  6818  //
  6819  //	string clientId The client id.
  6820  //	string clientSecret The client id.
  6821  //	string userCode The end-user verification code.
  6822  func (c *FusionAuthClient) RetrieveUserCodeWithContext(ctx context.Context, clientId string, clientSecret string, userCode string) (*BaseHTTPResponse, error) {
  6823  	var resp BaseHTTPResponse
  6824  	formBody := url.Values{}
  6825  	formBody.Set("client_id", clientId)
  6826  	formBody.Set("client_secret", clientSecret)
  6827  	formBody.Set("user_code", userCode)
  6828  
  6829  	err := c.StartAnonymous(&resp, nil).
  6830  		WithUri("/oauth2/device/user-code").
  6831  		WithFormData(formBody).
  6832  		WithMethod(http.MethodGet).
  6833  		Do(ctx)
  6834  	return &resp, err
  6835  }
  6836  
  6837  // RetrieveUserCodeUsingAPIKey
  6838  // Retrieve a user_code that is part of an in-progress Device Authorization Grant.
  6839  //
  6840  // This API is useful if you want to build your own login workflow to complete a device grant.
  6841  //
  6842  // This request will require an API key.
  6843  //
  6844  //	string userCode The end-user verification code.
  6845  func (c *FusionAuthClient) RetrieveUserCodeUsingAPIKey(userCode string) (*BaseHTTPResponse, error) {
  6846  	return c.RetrieveUserCodeUsingAPIKeyWithContext(context.TODO(), userCode)
  6847  }
  6848  
  6849  // RetrieveUserCodeUsingAPIKeyWithContext
  6850  // Retrieve a user_code that is part of an in-progress Device Authorization Grant.
  6851  //
  6852  // This API is useful if you want to build your own login workflow to complete a device grant.
  6853  //
  6854  // This request will require an API key.
  6855  //
  6856  //	string userCode The end-user verification code.
  6857  func (c *FusionAuthClient) RetrieveUserCodeUsingAPIKeyWithContext(ctx context.Context, userCode string) (*BaseHTTPResponse, error) {
  6858  	var resp BaseHTTPResponse
  6859  	formBody := url.Values{}
  6860  	formBody.Set("user_code", userCode)
  6861  
  6862  	err := c.StartAnonymous(&resp, nil).
  6863  		WithUri("/oauth2/device/user-code").
  6864  		WithFormData(formBody).
  6865  		WithMethod(http.MethodGet).
  6866  		Do(ctx)
  6867  	return &resp, err
  6868  }
  6869  
  6870  // RetrieveUserComments
  6871  // Retrieves all the comments for the user with the given Id.
  6872  //
  6873  //	string userId The Id of the user.
  6874  func (c *FusionAuthClient) RetrieveUserComments(userId string) (*UserCommentResponse, *Errors, error) {
  6875  	return c.RetrieveUserCommentsWithContext(context.TODO(), userId)
  6876  }
  6877  
  6878  // RetrieveUserCommentsWithContext
  6879  // Retrieves all the comments for the user with the given Id.
  6880  //
  6881  //	string userId The Id of the user.
  6882  func (c *FusionAuthClient) RetrieveUserCommentsWithContext(ctx context.Context, userId string) (*UserCommentResponse, *Errors, error) {
  6883  	var resp UserCommentResponse
  6884  	var errors Errors
  6885  
  6886  	restClient := c.Start(&resp, &errors)
  6887  	err := restClient.WithUri("/api/user/comment").
  6888  		WithUriSegment(userId).
  6889  		WithMethod(http.MethodGet).
  6890  		Do(ctx)
  6891  	if restClient.ErrorRef == nil {
  6892  		return &resp, nil, err
  6893  	}
  6894  	return &resp, &errors, err
  6895  }
  6896  
  6897  // RetrieveUserConsent
  6898  // Retrieve a single User consent by Id.
  6899  //
  6900  //	string userConsentId The User consent Id
  6901  func (c *FusionAuthClient) RetrieveUserConsent(userConsentId string) (*UserConsentResponse, error) {
  6902  	return c.RetrieveUserConsentWithContext(context.TODO(), userConsentId)
  6903  }
  6904  
  6905  // RetrieveUserConsentWithContext
  6906  // Retrieve a single User consent by Id.
  6907  //
  6908  //	string userConsentId The User consent Id
  6909  func (c *FusionAuthClient) RetrieveUserConsentWithContext(ctx context.Context, userConsentId string) (*UserConsentResponse, error) {
  6910  	var resp UserConsentResponse
  6911  
  6912  	err := c.Start(&resp, nil).
  6913  		WithUri("/api/user/consent").
  6914  		WithUriSegment(userConsentId).
  6915  		WithMethod(http.MethodGet).
  6916  		Do(ctx)
  6917  	return &resp, err
  6918  }
  6919  
  6920  // RetrieveUserConsents
  6921  // Retrieves all the consents for a User.
  6922  //
  6923  //	string userId The User's Id
  6924  func (c *FusionAuthClient) RetrieveUserConsents(userId string) (*UserConsentResponse, error) {
  6925  	return c.RetrieveUserConsentsWithContext(context.TODO(), userId)
  6926  }
  6927  
  6928  // RetrieveUserConsentsWithContext
  6929  // Retrieves all the consents for a User.
  6930  //
  6931  //	string userId The User's Id
  6932  func (c *FusionAuthClient) RetrieveUserConsentsWithContext(ctx context.Context, userId string) (*UserConsentResponse, error) {
  6933  	var resp UserConsentResponse
  6934  
  6935  	err := c.Start(&resp, nil).
  6936  		WithUri("/api/user/consent").
  6937  		WithParameter("userId", userId).
  6938  		WithMethod(http.MethodGet).
  6939  		Do(ctx)
  6940  	return &resp, err
  6941  }
  6942  
  6943  // RetrieveUserLink
  6944  // Retrieve a single Identity Provider user (link).
  6945  //
  6946  //	string identityProviderId The unique Id of the identity provider.
  6947  //	string identityProviderUserId The unique Id of the user in the 3rd party identity provider.
  6948  //	string userId The unique Id of the FusionAuth user.
  6949  func (c *FusionAuthClient) RetrieveUserLink(identityProviderId string, identityProviderUserId string, userId string) (*IdentityProviderLinkResponse, *Errors, error) {
  6950  	return c.RetrieveUserLinkWithContext(context.TODO(), identityProviderId, identityProviderUserId, userId)
  6951  }
  6952  
  6953  // RetrieveUserLinkWithContext
  6954  // Retrieve a single Identity Provider user (link).
  6955  //
  6956  //	string identityProviderId The unique Id of the identity provider.
  6957  //	string identityProviderUserId The unique Id of the user in the 3rd party identity provider.
  6958  //	string userId The unique Id of the FusionAuth user.
  6959  func (c *FusionAuthClient) RetrieveUserLinkWithContext(ctx context.Context, identityProviderId string, identityProviderUserId string, userId string) (*IdentityProviderLinkResponse, *Errors, error) {
  6960  	var resp IdentityProviderLinkResponse
  6961  	var errors Errors
  6962  
  6963  	restClient := c.Start(&resp, &errors)
  6964  	err := restClient.WithUri("/api/identity-provider/link").
  6965  		WithParameter("identityProviderId", identityProviderId).
  6966  		WithParameter("identityProviderUserId", identityProviderUserId).
  6967  		WithParameter("userId", userId).
  6968  		WithMethod(http.MethodGet).
  6969  		Do(ctx)
  6970  	if restClient.ErrorRef == nil {
  6971  		return &resp, nil, err
  6972  	}
  6973  	return &resp, &errors, err
  6974  }
  6975  
  6976  // RetrieveUserLinksByUserId
  6977  // Retrieve all Identity Provider users (links) for the user. Specify the optional identityProviderId to retrieve links for a particular IdP.
  6978  //
  6979  //	string identityProviderId (Optional) The unique Id of the identity provider. Specify this value to reduce the links returned to those for a particular IdP.
  6980  //	string userId The unique Id of the user.
  6981  func (c *FusionAuthClient) RetrieveUserLinksByUserId(identityProviderId string, userId string) (*IdentityProviderLinkResponse, *Errors, error) {
  6982  	return c.RetrieveUserLinksByUserIdWithContext(context.TODO(), identityProviderId, userId)
  6983  }
  6984  
  6985  // RetrieveUserLinksByUserIdWithContext
  6986  // Retrieve all Identity Provider users (links) for the user. Specify the optional identityProviderId to retrieve links for a particular IdP.
  6987  //
  6988  //	string identityProviderId (Optional) The unique Id of the identity provider. Specify this value to reduce the links returned to those for a particular IdP.
  6989  //	string userId The unique Id of the user.
  6990  func (c *FusionAuthClient) RetrieveUserLinksByUserIdWithContext(ctx context.Context, identityProviderId string, userId string) (*IdentityProviderLinkResponse, *Errors, error) {
  6991  	var resp IdentityProviderLinkResponse
  6992  	var errors Errors
  6993  
  6994  	restClient := c.Start(&resp, &errors)
  6995  	err := restClient.WithUri("/api/identity-provider/link").
  6996  		WithParameter("identityProviderId", identityProviderId).
  6997  		WithParameter("userId", userId).
  6998  		WithMethod(http.MethodGet).
  6999  		Do(ctx)
  7000  	if restClient.ErrorRef == nil {
  7001  		return &resp, nil, err
  7002  	}
  7003  	return &resp, &errors, err
  7004  }
  7005  
  7006  // RetrieveUserLoginReport
  7007  // Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the
  7008  // login counts for that application.
  7009  //
  7010  //	string applicationId (Optional) The application id.
  7011  //	string userId The userId id.
  7012  //	int64 start The start instant as UTC milliseconds since Epoch.
  7013  //	int64 end The end instant as UTC milliseconds since Epoch.
  7014  func (c *FusionAuthClient) RetrieveUserLoginReport(applicationId string, userId string, start int64, end int64) (*LoginReportResponse, *Errors, error) {
  7015  	return c.RetrieveUserLoginReportWithContext(context.TODO(), applicationId, userId, start, end)
  7016  }
  7017  
  7018  // RetrieveUserLoginReportWithContext
  7019  // Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the
  7020  // login counts for that application.
  7021  //
  7022  //	string applicationId (Optional) The application id.
  7023  //	string userId The userId id.
  7024  //	int64 start The start instant as UTC milliseconds since Epoch.
  7025  //	int64 end The end instant as UTC milliseconds since Epoch.
  7026  func (c *FusionAuthClient) RetrieveUserLoginReportWithContext(ctx context.Context, applicationId string, userId string, start int64, end int64) (*LoginReportResponse, *Errors, error) {
  7027  	var resp LoginReportResponse
  7028  	var errors Errors
  7029  
  7030  	restClient := c.Start(&resp, &errors)
  7031  	err := restClient.WithUri("/api/report/login").
  7032  		WithParameter("applicationId", applicationId).
  7033  		WithParameter("userId", userId).
  7034  		WithParameter("start", strconv.FormatInt(start, 10)).
  7035  		WithParameter("end", strconv.FormatInt(end, 10)).
  7036  		WithMethod(http.MethodGet).
  7037  		Do(ctx)
  7038  	if restClient.ErrorRef == nil {
  7039  		return &resp, nil, err
  7040  	}
  7041  	return &resp, &errors, err
  7042  }
  7043  
  7044  // RetrieveUserLoginReportByLoginId
  7045  // Retrieves the login report between the two instants for a particular user by login Id. If you specify an application id, it will only return the
  7046  // login counts for that application.
  7047  //
  7048  //	string applicationId (Optional) The application id.
  7049  //	string loginId The userId id.
  7050  //	int64 start The start instant as UTC milliseconds since Epoch.
  7051  //	int64 end The end instant as UTC milliseconds since Epoch.
  7052  func (c *FusionAuthClient) RetrieveUserLoginReportByLoginId(applicationId string, loginId string, start int64, end int64) (*LoginReportResponse, *Errors, error) {
  7053  	return c.RetrieveUserLoginReportByLoginIdWithContext(context.TODO(), applicationId, loginId, start, end)
  7054  }
  7055  
  7056  // RetrieveUserLoginReportByLoginIdWithContext
  7057  // Retrieves the login report between the two instants for a particular user by login Id. If you specify an application id, it will only return the
  7058  // login counts for that application.
  7059  //
  7060  //	string applicationId (Optional) The application id.
  7061  //	string loginId The userId id.
  7062  //	int64 start The start instant as UTC milliseconds since Epoch.
  7063  //	int64 end The end instant as UTC milliseconds since Epoch.
  7064  func (c *FusionAuthClient) RetrieveUserLoginReportByLoginIdWithContext(ctx context.Context, applicationId string, loginId string, start int64, end int64) (*LoginReportResponse, *Errors, error) {
  7065  	var resp LoginReportResponse
  7066  	var errors Errors
  7067  
  7068  	restClient := c.Start(&resp, &errors)
  7069  	err := restClient.WithUri("/api/report/login").
  7070  		WithParameter("applicationId", applicationId).
  7071  		WithParameter("loginId", loginId).
  7072  		WithParameter("start", strconv.FormatInt(start, 10)).
  7073  		WithParameter("end", strconv.FormatInt(end, 10)).
  7074  		WithMethod(http.MethodGet).
  7075  		Do(ctx)
  7076  	if restClient.ErrorRef == nil {
  7077  		return &resp, nil, err
  7078  	}
  7079  	return &resp, &errors, err
  7080  }
  7081  
  7082  // RetrieveUserRecentLogins
  7083  // Retrieves the last number of login records for a user.
  7084  //
  7085  //	string userId The Id of the user.
  7086  //	int offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.
  7087  //	int limit (Optional, defaults to 10) The number of records to retrieve.
  7088  func (c *FusionAuthClient) RetrieveUserRecentLogins(userId string, offset int, limit int) (*RecentLoginResponse, *Errors, error) {
  7089  	return c.RetrieveUserRecentLoginsWithContext(context.TODO(), userId, offset, limit)
  7090  }
  7091  
  7092  // RetrieveUserRecentLoginsWithContext
  7093  // Retrieves the last number of login records for a user.
  7094  //
  7095  //	string userId The Id of the user.
  7096  //	int offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login.
  7097  //	int limit (Optional, defaults to 10) The number of records to retrieve.
  7098  func (c *FusionAuthClient) RetrieveUserRecentLoginsWithContext(ctx context.Context, userId string, offset int, limit int) (*RecentLoginResponse, *Errors, error) {
  7099  	var resp RecentLoginResponse
  7100  	var errors Errors
  7101  
  7102  	restClient := c.Start(&resp, &errors)
  7103  	err := restClient.WithUri("/api/user/recent-login").
  7104  		WithParameter("userId", userId).
  7105  		WithParameter("offset", strconv.Itoa(offset)).
  7106  		WithParameter("limit", strconv.Itoa(limit)).
  7107  		WithMethod(http.MethodGet).
  7108  		Do(ctx)
  7109  	if restClient.ErrorRef == nil {
  7110  		return &resp, nil, err
  7111  	}
  7112  	return &resp, &errors, err
  7113  }
  7114  
  7115  // RetrieveUserUsingJWT
  7116  // Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.
  7117  //
  7118  //	string encodedJWT The encoded JWT (access token).
  7119  func (c *FusionAuthClient) RetrieveUserUsingJWT(encodedJWT string) (*UserResponse, *Errors, error) {
  7120  	return c.RetrieveUserUsingJWTWithContext(context.TODO(), encodedJWT)
  7121  }
  7122  
  7123  // RetrieveUserUsingJWTWithContext
  7124  // Retrieves the user for the given Id. This method does not use an API key, instead it uses a JSON Web Token (JWT) for authentication.
  7125  //
  7126  //	string encodedJWT The encoded JWT (access token).
  7127  func (c *FusionAuthClient) RetrieveUserUsingJWTWithContext(ctx context.Context, encodedJWT string) (*UserResponse, *Errors, error) {
  7128  	var resp UserResponse
  7129  	var errors Errors
  7130  
  7131  	restClient := c.StartAnonymous(&resp, &errors)
  7132  	err := restClient.WithUri("/api/user").
  7133  		WithAuthorization("Bearer " + encodedJWT).
  7134  		WithMethod(http.MethodGet).
  7135  		Do(ctx)
  7136  	if restClient.ErrorRef == nil {
  7137  		return &resp, nil, err
  7138  	}
  7139  	return &resp, &errors, err
  7140  }
  7141  
  7142  // RetrieveVersion
  7143  // Retrieves the FusionAuth version string.
  7144  func (c *FusionAuthClient) RetrieveVersion() (*VersionResponse, *Errors, error) {
  7145  	return c.RetrieveVersionWithContext(context.TODO())
  7146  }
  7147  
  7148  // RetrieveVersionWithContext
  7149  // Retrieves the FusionAuth version string.
  7150  func (c *FusionAuthClient) RetrieveVersionWithContext(ctx context.Context) (*VersionResponse, *Errors, error) {
  7151  	var resp VersionResponse
  7152  	var errors Errors
  7153  
  7154  	restClient := c.Start(&resp, &errors)
  7155  	err := restClient.WithUri("/api/system/version").
  7156  		WithMethod(http.MethodGet).
  7157  		Do(ctx)
  7158  	if restClient.ErrorRef == nil {
  7159  		return &resp, nil, err
  7160  	}
  7161  	return &resp, &errors, err
  7162  }
  7163  
  7164  // RetrieveWebAuthnCredential
  7165  // Retrieves the WebAuthn credential for the given Id.
  7166  //
  7167  //	string id The Id of the WebAuthn credential.
  7168  func (c *FusionAuthClient) RetrieveWebAuthnCredential(id string) (*WebAuthnCredentialResponse, *Errors, error) {
  7169  	return c.RetrieveWebAuthnCredentialWithContext(context.TODO(), id)
  7170  }
  7171  
  7172  // RetrieveWebAuthnCredentialWithContext
  7173  // Retrieves the WebAuthn credential for the given Id.
  7174  //
  7175  //	string id The Id of the WebAuthn credential.
  7176  func (c *FusionAuthClient) RetrieveWebAuthnCredentialWithContext(ctx context.Context, id string) (*WebAuthnCredentialResponse, *Errors, error) {
  7177  	var resp WebAuthnCredentialResponse
  7178  	var errors Errors
  7179  
  7180  	restClient := c.Start(&resp, &errors)
  7181  	err := restClient.WithUri("/api/webauthn").
  7182  		WithUriSegment(id).
  7183  		WithMethod(http.MethodGet).
  7184  		Do(ctx)
  7185  	if restClient.ErrorRef == nil {
  7186  		return &resp, nil, err
  7187  	}
  7188  	return &resp, &errors, err
  7189  }
  7190  
  7191  // RetrieveWebAuthnCredentialsForUser
  7192  // Retrieves all WebAuthn credentials for the given user.
  7193  //
  7194  //	string userId The user's ID.
  7195  func (c *FusionAuthClient) RetrieveWebAuthnCredentialsForUser(userId string) (*WebAuthnCredentialResponse, *Errors, error) {
  7196  	return c.RetrieveWebAuthnCredentialsForUserWithContext(context.TODO(), userId)
  7197  }
  7198  
  7199  // RetrieveWebAuthnCredentialsForUserWithContext
  7200  // Retrieves all WebAuthn credentials for the given user.
  7201  //
  7202  //	string userId The user's ID.
  7203  func (c *FusionAuthClient) RetrieveWebAuthnCredentialsForUserWithContext(ctx context.Context, userId string) (*WebAuthnCredentialResponse, *Errors, error) {
  7204  	var resp WebAuthnCredentialResponse
  7205  	var errors Errors
  7206  
  7207  	restClient := c.Start(&resp, &errors)
  7208  	err := restClient.WithUri("/api/webauthn").
  7209  		WithParameter("userId", userId).
  7210  		WithMethod(http.MethodGet).
  7211  		Do(ctx)
  7212  	if restClient.ErrorRef == nil {
  7213  		return &resp, nil, err
  7214  	}
  7215  	return &resp, &errors, err
  7216  }
  7217  
  7218  // RetrieveWebhook
  7219  // Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
  7220  //
  7221  //	string webhookId (Optional) The Id of the webhook.
  7222  func (c *FusionAuthClient) RetrieveWebhook(webhookId string) (*WebhookResponse, error) {
  7223  	return c.RetrieveWebhookWithContext(context.TODO(), webhookId)
  7224  }
  7225  
  7226  // RetrieveWebhookWithContext
  7227  // Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks.
  7228  //
  7229  //	string webhookId (Optional) The Id of the webhook.
  7230  func (c *FusionAuthClient) RetrieveWebhookWithContext(ctx context.Context, webhookId string) (*WebhookResponse, error) {
  7231  	var resp WebhookResponse
  7232  
  7233  	err := c.Start(&resp, nil).
  7234  		WithUri("/api/webhook").
  7235  		WithUriSegment(webhookId).
  7236  		WithMethod(http.MethodGet).
  7237  		Do(ctx)
  7238  	return &resp, err
  7239  }
  7240  
  7241  // RetrieveWebhooks
  7242  // Retrieves all the webhooks.
  7243  func (c *FusionAuthClient) RetrieveWebhooks() (*WebhookResponse, error) {
  7244  	return c.RetrieveWebhooksWithContext(context.TODO())
  7245  }
  7246  
  7247  // RetrieveWebhooksWithContext
  7248  // Retrieves all the webhooks.
  7249  func (c *FusionAuthClient) RetrieveWebhooksWithContext(ctx context.Context) (*WebhookResponse, error) {
  7250  	var resp WebhookResponse
  7251  
  7252  	err := c.Start(&resp, nil).
  7253  		WithUri("/api/webhook").
  7254  		WithMethod(http.MethodGet).
  7255  		Do(ctx)
  7256  	return &resp, err
  7257  }
  7258  
  7259  // RevokeRefreshToken
  7260  // Revokes refresh tokens.
  7261  //
  7262  // Usage examples:
  7263  //
  7264  //   - Delete a single refresh token, pass in only the token.
  7265  //     revokeRefreshToken(token)
  7266  //
  7267  //   - Delete all refresh tokens for a user, pass in only the userId.
  7268  //     revokeRefreshToken(null, userId)
  7269  //
  7270  //   - Delete all refresh tokens for a user for a specific application, pass in both the userId and the applicationId.
  7271  //     revokeRefreshToken(null, userId, applicationId)
  7272  //
  7273  //   - Delete all refresh tokens for an application
  7274  //     revokeRefreshToken(null, null, applicationId)
  7275  //
  7276  // Note: <code>null</code> may be handled differently depending upon the programming language.
  7277  //
  7278  // See also: (method names may vary by language... but you'll figure it out)
  7279  //
  7280  //   - revokeRefreshTokenById
  7281  //   - revokeRefreshTokenByToken
  7282  //   - revokeRefreshTokensByUserId
  7283  //   - revokeRefreshTokensByApplicationId
  7284  //   - revokeRefreshTokensByUserIdForApplication
  7285  //     string token (Optional) The refresh token to delete.
  7286  //     string userId (Optional) The user Id whose tokens to delete.
  7287  //     string applicationId (Optional) The application Id of the tokens to delete.
  7288  func (c *FusionAuthClient) RevokeRefreshToken(token string, userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  7289  	return c.RevokeRefreshTokenWithContext(context.TODO(), token, userId, applicationId)
  7290  }
  7291  
  7292  // RevokeRefreshTokenWithContext
  7293  // Revokes refresh tokens.
  7294  //
  7295  // Usage examples:
  7296  //
  7297  //   - Delete a single refresh token, pass in only the token.
  7298  //     revokeRefreshToken(token)
  7299  //
  7300  //   - Delete all refresh tokens for a user, pass in only the userId.
  7301  //     revokeRefreshToken(null, userId)
  7302  //
  7303  //   - Delete all refresh tokens for a user for a specific application, pass in both the userId and the applicationId.
  7304  //     revokeRefreshToken(null, userId, applicationId)
  7305  //
  7306  //   - Delete all refresh tokens for an application
  7307  //     revokeRefreshToken(null, null, applicationId)
  7308  //
  7309  // Note: <code>null</code> may be handled differently depending upon the programming language.
  7310  //
  7311  // See also: (method names may vary by language... but you'll figure it out)
  7312  //
  7313  //   - revokeRefreshTokenById
  7314  //   - revokeRefreshTokenByToken
  7315  //   - revokeRefreshTokensByUserId
  7316  //   - revokeRefreshTokensByApplicationId
  7317  //   - revokeRefreshTokensByUserIdForApplication
  7318  //     string token (Optional) The refresh token to delete.
  7319  //     string userId (Optional) The user Id whose tokens to delete.
  7320  //     string applicationId (Optional) The application Id of the tokens to delete.
  7321  func (c *FusionAuthClient) RevokeRefreshTokenWithContext(ctx context.Context, token string, userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  7322  	var resp BaseHTTPResponse
  7323  	var errors Errors
  7324  
  7325  	restClient := c.Start(&resp, &errors)
  7326  	err := restClient.WithUri("/api/jwt/refresh").
  7327  		WithParameter("token", token).
  7328  		WithParameter("userId", userId).
  7329  		WithParameter("applicationId", applicationId).
  7330  		WithMethod(http.MethodDelete).
  7331  		Do(ctx)
  7332  	if restClient.ErrorRef == nil {
  7333  		return &resp, nil, err
  7334  	}
  7335  	return &resp, &errors, err
  7336  }
  7337  
  7338  // RevokeRefreshTokenById
  7339  // Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.
  7340  //
  7341  //	string tokenId The unique Id of the token to delete.
  7342  func (c *FusionAuthClient) RevokeRefreshTokenById(tokenId string) (*BaseHTTPResponse, *Errors, error) {
  7343  	return c.RevokeRefreshTokenByIdWithContext(context.TODO(), tokenId)
  7344  }
  7345  
  7346  // RevokeRefreshTokenByIdWithContext
  7347  // Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.
  7348  //
  7349  //	string tokenId The unique Id of the token to delete.
  7350  func (c *FusionAuthClient) RevokeRefreshTokenByIdWithContext(ctx context.Context, tokenId string) (*BaseHTTPResponse, *Errors, error) {
  7351  	var resp BaseHTTPResponse
  7352  	var errors Errors
  7353  
  7354  	restClient := c.Start(&resp, &errors)
  7355  	err := restClient.WithUri("/api/jwt/refresh").
  7356  		WithUriSegment(tokenId).
  7357  		WithMethod(http.MethodDelete).
  7358  		Do(ctx)
  7359  	if restClient.ErrorRef == nil {
  7360  		return &resp, nil, err
  7361  	}
  7362  	return &resp, &errors, err
  7363  }
  7364  
  7365  // RevokeRefreshTokenByToken
  7366  // Revokes a single refresh token by using the actual refresh token value. This refresh token value is sensitive, so  be careful with this API request.
  7367  //
  7368  //	string token The refresh token to delete.
  7369  func (c *FusionAuthClient) RevokeRefreshTokenByToken(token string) (*BaseHTTPResponse, *Errors, error) {
  7370  	return c.RevokeRefreshTokenByTokenWithContext(context.TODO(), token)
  7371  }
  7372  
  7373  // RevokeRefreshTokenByTokenWithContext
  7374  // Revokes a single refresh token by using the actual refresh token value. This refresh token value is sensitive, so  be careful with this API request.
  7375  //
  7376  //	string token The refresh token to delete.
  7377  func (c *FusionAuthClient) RevokeRefreshTokenByTokenWithContext(ctx context.Context, token string) (*BaseHTTPResponse, *Errors, error) {
  7378  	var resp BaseHTTPResponse
  7379  	var errors Errors
  7380  
  7381  	restClient := c.Start(&resp, &errors)
  7382  	err := restClient.WithUri("/api/jwt/refresh").
  7383  		WithParameter("token", token).
  7384  		WithMethod(http.MethodDelete).
  7385  		Do(ctx)
  7386  	if restClient.ErrorRef == nil {
  7387  		return &resp, nil, err
  7388  	}
  7389  	return &resp, &errors, err
  7390  }
  7391  
  7392  // RevokeRefreshTokensByApplicationId
  7393  // Revoke all refresh tokens that belong to an application by applicationId.
  7394  //
  7395  //	string applicationId The unique Id of the application that you want to delete all refresh tokens for.
  7396  func (c *FusionAuthClient) RevokeRefreshTokensByApplicationId(applicationId string) (*BaseHTTPResponse, *Errors, error) {
  7397  	return c.RevokeRefreshTokensByApplicationIdWithContext(context.TODO(), applicationId)
  7398  }
  7399  
  7400  // RevokeRefreshTokensByApplicationIdWithContext
  7401  // Revoke all refresh tokens that belong to an application by applicationId.
  7402  //
  7403  //	string applicationId The unique Id of the application that you want to delete all refresh tokens for.
  7404  func (c *FusionAuthClient) RevokeRefreshTokensByApplicationIdWithContext(ctx context.Context, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  7405  	var resp BaseHTTPResponse
  7406  	var errors Errors
  7407  
  7408  	restClient := c.Start(&resp, &errors)
  7409  	err := restClient.WithUri("/api/jwt/refresh").
  7410  		WithParameter("applicationId", applicationId).
  7411  		WithMethod(http.MethodDelete).
  7412  		Do(ctx)
  7413  	if restClient.ErrorRef == nil {
  7414  		return &resp, nil, err
  7415  	}
  7416  	return &resp, &errors, err
  7417  }
  7418  
  7419  // RevokeRefreshTokensByUserId
  7420  // Revoke all refresh tokens that belong to a user by user Id.
  7421  //
  7422  //	string userId The unique Id of the user that you want to delete all refresh tokens for.
  7423  func (c *FusionAuthClient) RevokeRefreshTokensByUserId(userId string) (*BaseHTTPResponse, *Errors, error) {
  7424  	return c.RevokeRefreshTokensByUserIdWithContext(context.TODO(), userId)
  7425  }
  7426  
  7427  // RevokeRefreshTokensByUserIdWithContext
  7428  // Revoke all refresh tokens that belong to a user by user Id.
  7429  //
  7430  //	string userId The unique Id of the user that you want to delete all refresh tokens for.
  7431  func (c *FusionAuthClient) RevokeRefreshTokensByUserIdWithContext(ctx context.Context, userId string) (*BaseHTTPResponse, *Errors, error) {
  7432  	var resp BaseHTTPResponse
  7433  	var errors Errors
  7434  
  7435  	restClient := c.Start(&resp, &errors)
  7436  	err := restClient.WithUri("/api/jwt/refresh").
  7437  		WithParameter("userId", userId).
  7438  		WithMethod(http.MethodDelete).
  7439  		Do(ctx)
  7440  	if restClient.ErrorRef == nil {
  7441  		return &resp, nil, err
  7442  	}
  7443  	return &resp, &errors, err
  7444  }
  7445  
  7446  // RevokeRefreshTokensByUserIdForApplication
  7447  // Revoke all refresh tokens that belong to a user by user Id for a specific application by applicationId.
  7448  //
  7449  //	string userId The unique Id of the user that you want to delete all refresh tokens for.
  7450  //	string applicationId The unique Id of the application that you want to delete refresh tokens for.
  7451  func (c *FusionAuthClient) RevokeRefreshTokensByUserIdForApplication(userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  7452  	return c.RevokeRefreshTokensByUserIdForApplicationWithContext(context.TODO(), userId, applicationId)
  7453  }
  7454  
  7455  // RevokeRefreshTokensByUserIdForApplicationWithContext
  7456  // Revoke all refresh tokens that belong to a user by user Id for a specific application by applicationId.
  7457  //
  7458  //	string userId The unique Id of the user that you want to delete all refresh tokens for.
  7459  //	string applicationId The unique Id of the application that you want to delete refresh tokens for.
  7460  func (c *FusionAuthClient) RevokeRefreshTokensByUserIdForApplicationWithContext(ctx context.Context, userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) {
  7461  	var resp BaseHTTPResponse
  7462  	var errors Errors
  7463  
  7464  	restClient := c.Start(&resp, &errors)
  7465  	err := restClient.WithUri("/api/jwt/refresh").
  7466  		WithParameter("userId", userId).
  7467  		WithParameter("applicationId", applicationId).
  7468  		WithMethod(http.MethodDelete).
  7469  		Do(ctx)
  7470  	if restClient.ErrorRef == nil {
  7471  		return &resp, nil, err
  7472  	}
  7473  	return &resp, &errors, err
  7474  }
  7475  
  7476  // RevokeRefreshTokensWithRequest
  7477  // Revokes refresh tokens using the information in the JSON body. The handling for this method is the same as the revokeRefreshToken method
  7478  // and is based on the information you provide in the RefreshDeleteRequest object. See that method for additional information.
  7479  //
  7480  //	RefreshTokenRevokeRequest request The request information used to revoke the refresh tokens.
  7481  func (c *FusionAuthClient) RevokeRefreshTokensWithRequest(request RefreshTokenRevokeRequest) (*BaseHTTPResponse, *Errors, error) {
  7482  	return c.RevokeRefreshTokensWithRequestWithContext(context.TODO(), request)
  7483  }
  7484  
  7485  // RevokeRefreshTokensWithRequestWithContext
  7486  // Revokes refresh tokens using the information in the JSON body. The handling for this method is the same as the revokeRefreshToken method
  7487  // and is based on the information you provide in the RefreshDeleteRequest object. See that method for additional information.
  7488  //
  7489  //	RefreshTokenRevokeRequest request The request information used to revoke the refresh tokens.
  7490  func (c *FusionAuthClient) RevokeRefreshTokensWithRequestWithContext(ctx context.Context, request RefreshTokenRevokeRequest) (*BaseHTTPResponse, *Errors, error) {
  7491  	var resp BaseHTTPResponse
  7492  	var errors Errors
  7493  
  7494  	restClient := c.Start(&resp, &errors)
  7495  	err := restClient.WithUri("/api/jwt/refresh").
  7496  		WithJSONBody(request).
  7497  		WithMethod(http.MethodDelete).
  7498  		Do(ctx)
  7499  	if restClient.ErrorRef == nil {
  7500  		return &resp, nil, err
  7501  	}
  7502  	return &resp, &errors, err
  7503  }
  7504  
  7505  // RevokeUserConsent
  7506  // Revokes a single User consent by Id.
  7507  //
  7508  //	string userConsentId The User Consent Id
  7509  func (c *FusionAuthClient) RevokeUserConsent(userConsentId string) (*BaseHTTPResponse, error) {
  7510  	return c.RevokeUserConsentWithContext(context.TODO(), userConsentId)
  7511  }
  7512  
  7513  // RevokeUserConsentWithContext
  7514  // Revokes a single User consent by Id.
  7515  //
  7516  //	string userConsentId The User Consent Id
  7517  func (c *FusionAuthClient) RevokeUserConsentWithContext(ctx context.Context, userConsentId string) (*BaseHTTPResponse, error) {
  7518  	var resp BaseHTTPResponse
  7519  
  7520  	err := c.Start(&resp, nil).
  7521  		WithUri("/api/user/consent").
  7522  		WithUriSegment(userConsentId).
  7523  		WithMethod(http.MethodDelete).
  7524  		Do(ctx)
  7525  	return &resp, err
  7526  }
  7527  
  7528  // SearchApplications
  7529  // Searches applications with the specified criteria and pagination.
  7530  //
  7531  //	ApplicationSearchRequest request The search criteria and pagination information.
  7532  func (c *FusionAuthClient) SearchApplications(request ApplicationSearchRequest) (*ApplicationSearchResponse, *Errors, error) {
  7533  	return c.SearchApplicationsWithContext(context.TODO(), request)
  7534  }
  7535  
  7536  // SearchApplicationsWithContext
  7537  // Searches applications with the specified criteria and pagination.
  7538  //
  7539  //	ApplicationSearchRequest request The search criteria and pagination information.
  7540  func (c *FusionAuthClient) SearchApplicationsWithContext(ctx context.Context, request ApplicationSearchRequest) (*ApplicationSearchResponse, *Errors, error) {
  7541  	var resp ApplicationSearchResponse
  7542  	var errors Errors
  7543  
  7544  	restClient := c.Start(&resp, &errors)
  7545  	err := restClient.WithUri("/api/application/search").
  7546  		WithJSONBody(request).
  7547  		WithMethod(http.MethodPost).
  7548  		Do(ctx)
  7549  	if restClient.ErrorRef == nil {
  7550  		return &resp, nil, err
  7551  	}
  7552  	return &resp, &errors, err
  7553  }
  7554  
  7555  // SearchAuditLogs
  7556  // Searches the audit logs with the specified criteria and pagination.
  7557  //
  7558  //	AuditLogSearchRequest request The search criteria and pagination information.
  7559  func (c *FusionAuthClient) SearchAuditLogs(request AuditLogSearchRequest) (*AuditLogSearchResponse, *Errors, error) {
  7560  	return c.SearchAuditLogsWithContext(context.TODO(), request)
  7561  }
  7562  
  7563  // SearchAuditLogsWithContext
  7564  // Searches the audit logs with the specified criteria and pagination.
  7565  //
  7566  //	AuditLogSearchRequest request The search criteria and pagination information.
  7567  func (c *FusionAuthClient) SearchAuditLogsWithContext(ctx context.Context, request AuditLogSearchRequest) (*AuditLogSearchResponse, *Errors, error) {
  7568  	var resp AuditLogSearchResponse
  7569  	var errors Errors
  7570  
  7571  	restClient := c.Start(&resp, &errors)
  7572  	err := restClient.WithUri("/api/system/audit-log/search").
  7573  		WithJSONBody(request).
  7574  		WithMethod(http.MethodPost).
  7575  		Do(ctx)
  7576  	if restClient.ErrorRef == nil {
  7577  		return &resp, nil, err
  7578  	}
  7579  	return &resp, &errors, err
  7580  }
  7581  
  7582  // SearchConsents
  7583  // Searches consents with the specified criteria and pagination.
  7584  //
  7585  //	ConsentSearchRequest request The search criteria and pagination information.
  7586  func (c *FusionAuthClient) SearchConsents(request ConsentSearchRequest) (*ConsentSearchResponse, *Errors, error) {
  7587  	return c.SearchConsentsWithContext(context.TODO(), request)
  7588  }
  7589  
  7590  // SearchConsentsWithContext
  7591  // Searches consents with the specified criteria and pagination.
  7592  //
  7593  //	ConsentSearchRequest request The search criteria and pagination information.
  7594  func (c *FusionAuthClient) SearchConsentsWithContext(ctx context.Context, request ConsentSearchRequest) (*ConsentSearchResponse, *Errors, error) {
  7595  	var resp ConsentSearchResponse
  7596  	var errors Errors
  7597  
  7598  	restClient := c.Start(&resp, &errors)
  7599  	err := restClient.WithUri("/api/consent/search").
  7600  		WithJSONBody(request).
  7601  		WithMethod(http.MethodPost).
  7602  		Do(ctx)
  7603  	if restClient.ErrorRef == nil {
  7604  		return &resp, nil, err
  7605  	}
  7606  	return &resp, &errors, err
  7607  }
  7608  
  7609  // SearchEmailTemplates
  7610  // Searches email templates with the specified criteria and pagination.
  7611  //
  7612  //	EmailTemplateSearchRequest request The search criteria and pagination information.
  7613  func (c *FusionAuthClient) SearchEmailTemplates(request EmailTemplateSearchRequest) (*EmailTemplateSearchResponse, *Errors, error) {
  7614  	return c.SearchEmailTemplatesWithContext(context.TODO(), request)
  7615  }
  7616  
  7617  // SearchEmailTemplatesWithContext
  7618  // Searches email templates with the specified criteria and pagination.
  7619  //
  7620  //	EmailTemplateSearchRequest request The search criteria and pagination information.
  7621  func (c *FusionAuthClient) SearchEmailTemplatesWithContext(ctx context.Context, request EmailTemplateSearchRequest) (*EmailTemplateSearchResponse, *Errors, error) {
  7622  	var resp EmailTemplateSearchResponse
  7623  	var errors Errors
  7624  
  7625  	restClient := c.Start(&resp, &errors)
  7626  	err := restClient.WithUri("/api/email/template/search").
  7627  		WithJSONBody(request).
  7628  		WithMethod(http.MethodPost).
  7629  		Do(ctx)
  7630  	if restClient.ErrorRef == nil {
  7631  		return &resp, nil, err
  7632  	}
  7633  	return &resp, &errors, err
  7634  }
  7635  
  7636  // SearchEntities
  7637  // Searches entities with the specified criteria and pagination.
  7638  //
  7639  //	EntitySearchRequest request The search criteria and pagination information.
  7640  func (c *FusionAuthClient) SearchEntities(request EntitySearchRequest) (*EntitySearchResponse, *Errors, error) {
  7641  	return c.SearchEntitiesWithContext(context.TODO(), request)
  7642  }
  7643  
  7644  // SearchEntitiesWithContext
  7645  // Searches entities with the specified criteria and pagination.
  7646  //
  7647  //	EntitySearchRequest request The search criteria and pagination information.
  7648  func (c *FusionAuthClient) SearchEntitiesWithContext(ctx context.Context, request EntitySearchRequest) (*EntitySearchResponse, *Errors, error) {
  7649  	var resp EntitySearchResponse
  7650  	var errors Errors
  7651  
  7652  	restClient := c.Start(&resp, &errors)
  7653  	err := restClient.WithUri("/api/entity/search").
  7654  		WithJSONBody(request).
  7655  		WithMethod(http.MethodPost).
  7656  		Do(ctx)
  7657  	if restClient.ErrorRef == nil {
  7658  		return &resp, nil, err
  7659  	}
  7660  	return &resp, &errors, err
  7661  }
  7662  
  7663  // SearchEntitiesByIds
  7664  // Retrieves the entities for the given ids. If any Id is invalid, it is ignored.
  7665  //
  7666  //	[]string ids The entity ids to search for.
  7667  func (c *FusionAuthClient) SearchEntitiesByIds(ids []string) (*EntitySearchResponse, *Errors, error) {
  7668  	return c.SearchEntitiesByIdsWithContext(context.TODO(), ids)
  7669  }
  7670  
  7671  // SearchEntitiesByIdsWithContext
  7672  // Retrieves the entities for the given ids. If any Id is invalid, it is ignored.
  7673  //
  7674  //	[]string ids The entity ids to search for.
  7675  func (c *FusionAuthClient) SearchEntitiesByIdsWithContext(ctx context.Context, ids []string) (*EntitySearchResponse, *Errors, error) {
  7676  	var resp EntitySearchResponse
  7677  	var errors Errors
  7678  
  7679  	restClient := c.Start(&resp, &errors)
  7680  	err := restClient.WithUri("/api/entity/search").
  7681  		WithParameter("ids", ids).
  7682  		WithMethod(http.MethodGet).
  7683  		Do(ctx)
  7684  	if restClient.ErrorRef == nil {
  7685  		return &resp, nil, err
  7686  	}
  7687  	return &resp, &errors, err
  7688  }
  7689  
  7690  // SearchEntityGrants
  7691  // Searches Entity Grants with the specified criteria and pagination.
  7692  //
  7693  //	EntityGrantSearchRequest request The search criteria and pagination information.
  7694  func (c *FusionAuthClient) SearchEntityGrants(request EntityGrantSearchRequest) (*EntityGrantSearchResponse, *Errors, error) {
  7695  	return c.SearchEntityGrantsWithContext(context.TODO(), request)
  7696  }
  7697  
  7698  // SearchEntityGrantsWithContext
  7699  // Searches Entity Grants with the specified criteria and pagination.
  7700  //
  7701  //	EntityGrantSearchRequest request The search criteria and pagination information.
  7702  func (c *FusionAuthClient) SearchEntityGrantsWithContext(ctx context.Context, request EntityGrantSearchRequest) (*EntityGrantSearchResponse, *Errors, error) {
  7703  	var resp EntityGrantSearchResponse
  7704  	var errors Errors
  7705  
  7706  	restClient := c.Start(&resp, &errors)
  7707  	err := restClient.WithUri("/api/entity/grant/search").
  7708  		WithJSONBody(request).
  7709  		WithMethod(http.MethodPost).
  7710  		Do(ctx)
  7711  	if restClient.ErrorRef == nil {
  7712  		return &resp, nil, err
  7713  	}
  7714  	return &resp, &errors, err
  7715  }
  7716  
  7717  // SearchEntityTypes
  7718  // Searches the entity types with the specified criteria and pagination.
  7719  //
  7720  //	EntityTypeSearchRequest request The search criteria and pagination information.
  7721  func (c *FusionAuthClient) SearchEntityTypes(request EntityTypeSearchRequest) (*EntityTypeSearchResponse, *Errors, error) {
  7722  	return c.SearchEntityTypesWithContext(context.TODO(), request)
  7723  }
  7724  
  7725  // SearchEntityTypesWithContext
  7726  // Searches the entity types with the specified criteria and pagination.
  7727  //
  7728  //	EntityTypeSearchRequest request The search criteria and pagination information.
  7729  func (c *FusionAuthClient) SearchEntityTypesWithContext(ctx context.Context, request EntityTypeSearchRequest) (*EntityTypeSearchResponse, *Errors, error) {
  7730  	var resp EntityTypeSearchResponse
  7731  	var errors Errors
  7732  
  7733  	restClient := c.Start(&resp, &errors)
  7734  	err := restClient.WithUri("/api/entity/type/search").
  7735  		WithJSONBody(request).
  7736  		WithMethod(http.MethodPost).
  7737  		Do(ctx)
  7738  	if restClient.ErrorRef == nil {
  7739  		return &resp, nil, err
  7740  	}
  7741  	return &resp, &errors, err
  7742  }
  7743  
  7744  // SearchEventLogs
  7745  // Searches the event logs with the specified criteria and pagination.
  7746  //
  7747  //	EventLogSearchRequest request The search criteria and pagination information.
  7748  func (c *FusionAuthClient) SearchEventLogs(request EventLogSearchRequest) (*EventLogSearchResponse, *Errors, error) {
  7749  	return c.SearchEventLogsWithContext(context.TODO(), request)
  7750  }
  7751  
  7752  // SearchEventLogsWithContext
  7753  // Searches the event logs with the specified criteria and pagination.
  7754  //
  7755  //	EventLogSearchRequest request The search criteria and pagination information.
  7756  func (c *FusionAuthClient) SearchEventLogsWithContext(ctx context.Context, request EventLogSearchRequest) (*EventLogSearchResponse, *Errors, error) {
  7757  	var resp EventLogSearchResponse
  7758  	var errors Errors
  7759  
  7760  	restClient := c.Start(&resp, &errors)
  7761  	err := restClient.WithUri("/api/system/event-log/search").
  7762  		WithJSONBody(request).
  7763  		WithMethod(http.MethodPost).
  7764  		Do(ctx)
  7765  	if restClient.ErrorRef == nil {
  7766  		return &resp, nil, err
  7767  	}
  7768  	return &resp, &errors, err
  7769  }
  7770  
  7771  // SearchGroupMembers
  7772  // Searches group members with the specified criteria and pagination.
  7773  //
  7774  //	GroupMemberSearchRequest request The search criteria and pagination information.
  7775  func (c *FusionAuthClient) SearchGroupMembers(request GroupMemberSearchRequest) (*GroupMemberSearchResponse, *Errors, error) {
  7776  	return c.SearchGroupMembersWithContext(context.TODO(), request)
  7777  }
  7778  
  7779  // SearchGroupMembersWithContext
  7780  // Searches group members with the specified criteria and pagination.
  7781  //
  7782  //	GroupMemberSearchRequest request The search criteria and pagination information.
  7783  func (c *FusionAuthClient) SearchGroupMembersWithContext(ctx context.Context, request GroupMemberSearchRequest) (*GroupMemberSearchResponse, *Errors, error) {
  7784  	var resp GroupMemberSearchResponse
  7785  	var errors Errors
  7786  
  7787  	restClient := c.Start(&resp, &errors)
  7788  	err := restClient.WithUri("/api/group/member/search").
  7789  		WithJSONBody(request).
  7790  		WithMethod(http.MethodPost).
  7791  		Do(ctx)
  7792  	if restClient.ErrorRef == nil {
  7793  		return &resp, nil, err
  7794  	}
  7795  	return &resp, &errors, err
  7796  }
  7797  
  7798  // SearchGroups
  7799  // Searches groups with the specified criteria and pagination.
  7800  //
  7801  //	GroupSearchRequest request The search criteria and pagination information.
  7802  func (c *FusionAuthClient) SearchGroups(request GroupSearchRequest) (*GroupSearchResponse, *Errors, error) {
  7803  	return c.SearchGroupsWithContext(context.TODO(), request)
  7804  }
  7805  
  7806  // SearchGroupsWithContext
  7807  // Searches groups with the specified criteria and pagination.
  7808  //
  7809  //	GroupSearchRequest request The search criteria and pagination information.
  7810  func (c *FusionAuthClient) SearchGroupsWithContext(ctx context.Context, request GroupSearchRequest) (*GroupSearchResponse, *Errors, error) {
  7811  	var resp GroupSearchResponse
  7812  	var errors Errors
  7813  
  7814  	restClient := c.Start(&resp, &errors)
  7815  	err := restClient.WithUri("/api/group/search").
  7816  		WithJSONBody(request).
  7817  		WithMethod(http.MethodPost).
  7818  		Do(ctx)
  7819  	if restClient.ErrorRef == nil {
  7820  		return &resp, nil, err
  7821  	}
  7822  	return &resp, &errors, err
  7823  }
  7824  
  7825  // SearchIPAccessControlLists
  7826  // Searches the IP Access Control Lists with the specified criteria and pagination.
  7827  //
  7828  //	IPAccessControlListSearchRequest request The search criteria and pagination information.
  7829  func (c *FusionAuthClient) SearchIPAccessControlLists(request IPAccessControlListSearchRequest) (*IPAccessControlListSearchResponse, *Errors, error) {
  7830  	return c.SearchIPAccessControlListsWithContext(context.TODO(), request)
  7831  }
  7832  
  7833  // SearchIPAccessControlListsWithContext
  7834  // Searches the IP Access Control Lists with the specified criteria and pagination.
  7835  //
  7836  //	IPAccessControlListSearchRequest request The search criteria and pagination information.
  7837  func (c *FusionAuthClient) SearchIPAccessControlListsWithContext(ctx context.Context, request IPAccessControlListSearchRequest) (*IPAccessControlListSearchResponse, *Errors, error) {
  7838  	var resp IPAccessControlListSearchResponse
  7839  	var errors Errors
  7840  
  7841  	restClient := c.Start(&resp, &errors)
  7842  	err := restClient.WithUri("/api/ip-acl/search").
  7843  		WithJSONBody(request).
  7844  		WithMethod(http.MethodPost).
  7845  		Do(ctx)
  7846  	if restClient.ErrorRef == nil {
  7847  		return &resp, nil, err
  7848  	}
  7849  	return &resp, &errors, err
  7850  }
  7851  
  7852  // SearchIdentityProviders
  7853  // Searches identity providers with the specified criteria and pagination.
  7854  //
  7855  //	IdentityProviderSearchRequest request The search criteria and pagination information.
  7856  func (c *FusionAuthClient) SearchIdentityProviders(request IdentityProviderSearchRequest) (*IdentityProviderSearchResponse, *Errors, error) {
  7857  	return c.SearchIdentityProvidersWithContext(context.TODO(), request)
  7858  }
  7859  
  7860  // SearchIdentityProvidersWithContext
  7861  // Searches identity providers with the specified criteria and pagination.
  7862  //
  7863  //	IdentityProviderSearchRequest request The search criteria and pagination information.
  7864  func (c *FusionAuthClient) SearchIdentityProvidersWithContext(ctx context.Context, request IdentityProviderSearchRequest) (*IdentityProviderSearchResponse, *Errors, error) {
  7865  	var resp IdentityProviderSearchResponse
  7866  	var errors Errors
  7867  
  7868  	restClient := c.Start(&resp, &errors)
  7869  	err := restClient.WithUri("/api/identity-provider/search").
  7870  		WithJSONBody(request).
  7871  		WithMethod(http.MethodPost).
  7872  		Do(ctx)
  7873  	if restClient.ErrorRef == nil {
  7874  		return &resp, nil, err
  7875  	}
  7876  	return &resp, &errors, err
  7877  }
  7878  
  7879  // SearchKeys
  7880  // Searches keys with the specified criteria and pagination.
  7881  //
  7882  //	KeySearchRequest request The search criteria and pagination information.
  7883  func (c *FusionAuthClient) SearchKeys(request KeySearchRequest) (*KeySearchResponse, *Errors, error) {
  7884  	return c.SearchKeysWithContext(context.TODO(), request)
  7885  }
  7886  
  7887  // SearchKeysWithContext
  7888  // Searches keys with the specified criteria and pagination.
  7889  //
  7890  //	KeySearchRequest request The search criteria and pagination information.
  7891  func (c *FusionAuthClient) SearchKeysWithContext(ctx context.Context, request KeySearchRequest) (*KeySearchResponse, *Errors, error) {
  7892  	var resp KeySearchResponse
  7893  	var errors Errors
  7894  
  7895  	restClient := c.Start(&resp, &errors)
  7896  	err := restClient.WithUri("/api/key/search").
  7897  		WithJSONBody(request).
  7898  		WithMethod(http.MethodPost).
  7899  		Do(ctx)
  7900  	if restClient.ErrorRef == nil {
  7901  		return &resp, nil, err
  7902  	}
  7903  	return &resp, &errors, err
  7904  }
  7905  
  7906  // SearchLambdas
  7907  // Searches lambdas with the specified criteria and pagination.
  7908  //
  7909  //	LambdaSearchRequest request The search criteria and pagination information.
  7910  func (c *FusionAuthClient) SearchLambdas(request LambdaSearchRequest) (*LambdaSearchResponse, *Errors, error) {
  7911  	return c.SearchLambdasWithContext(context.TODO(), request)
  7912  }
  7913  
  7914  // SearchLambdasWithContext
  7915  // Searches lambdas with the specified criteria and pagination.
  7916  //
  7917  //	LambdaSearchRequest request The search criteria and pagination information.
  7918  func (c *FusionAuthClient) SearchLambdasWithContext(ctx context.Context, request LambdaSearchRequest) (*LambdaSearchResponse, *Errors, error) {
  7919  	var resp LambdaSearchResponse
  7920  	var errors Errors
  7921  
  7922  	restClient := c.Start(&resp, &errors)
  7923  	err := restClient.WithUri("/api/lambda/search").
  7924  		WithJSONBody(request).
  7925  		WithMethod(http.MethodPost).
  7926  		Do(ctx)
  7927  	if restClient.ErrorRef == nil {
  7928  		return &resp, nil, err
  7929  	}
  7930  	return &resp, &errors, err
  7931  }
  7932  
  7933  // SearchLoginRecords
  7934  // Searches the login records with the specified criteria and pagination.
  7935  //
  7936  //	LoginRecordSearchRequest request The search criteria and pagination information.
  7937  func (c *FusionAuthClient) SearchLoginRecords(request LoginRecordSearchRequest) (*LoginRecordSearchResponse, *Errors, error) {
  7938  	return c.SearchLoginRecordsWithContext(context.TODO(), request)
  7939  }
  7940  
  7941  // SearchLoginRecordsWithContext
  7942  // Searches the login records with the specified criteria and pagination.
  7943  //
  7944  //	LoginRecordSearchRequest request The search criteria and pagination information.
  7945  func (c *FusionAuthClient) SearchLoginRecordsWithContext(ctx context.Context, request LoginRecordSearchRequest) (*LoginRecordSearchResponse, *Errors, error) {
  7946  	var resp LoginRecordSearchResponse
  7947  	var errors Errors
  7948  
  7949  	restClient := c.Start(&resp, &errors)
  7950  	err := restClient.WithUri("/api/system/login-record/search").
  7951  		WithJSONBody(request).
  7952  		WithMethod(http.MethodPost).
  7953  		Do(ctx)
  7954  	if restClient.ErrorRef == nil {
  7955  		return &resp, nil, err
  7956  	}
  7957  	return &resp, &errors, err
  7958  }
  7959  
  7960  // SearchTenants
  7961  // Searches tenants with the specified criteria and pagination.
  7962  //
  7963  //	TenantSearchRequest request The search criteria and pagination information.
  7964  func (c *FusionAuthClient) SearchTenants(request TenantSearchRequest) (*TenantSearchResponse, *Errors, error) {
  7965  	return c.SearchTenantsWithContext(context.TODO(), request)
  7966  }
  7967  
  7968  // SearchTenantsWithContext
  7969  // Searches tenants with the specified criteria and pagination.
  7970  //
  7971  //	TenantSearchRequest request The search criteria and pagination information.
  7972  func (c *FusionAuthClient) SearchTenantsWithContext(ctx context.Context, request TenantSearchRequest) (*TenantSearchResponse, *Errors, error) {
  7973  	var resp TenantSearchResponse
  7974  	var errors Errors
  7975  
  7976  	restClient := c.Start(&resp, &errors)
  7977  	err := restClient.WithUri("/api/tenant/search").
  7978  		WithJSONBody(request).
  7979  		WithMethod(http.MethodPost).
  7980  		Do(ctx)
  7981  	if restClient.ErrorRef == nil {
  7982  		return &resp, nil, err
  7983  	}
  7984  	return &resp, &errors, err
  7985  }
  7986  
  7987  // SearchThemes
  7988  // Searches themes with the specified criteria and pagination.
  7989  //
  7990  //	ThemeSearchRequest request The search criteria and pagination information.
  7991  func (c *FusionAuthClient) SearchThemes(request ThemeSearchRequest) (*ThemeSearchResponse, *Errors, error) {
  7992  	return c.SearchThemesWithContext(context.TODO(), request)
  7993  }
  7994  
  7995  // SearchThemesWithContext
  7996  // Searches themes with the specified criteria and pagination.
  7997  //
  7998  //	ThemeSearchRequest request The search criteria and pagination information.
  7999  func (c *FusionAuthClient) SearchThemesWithContext(ctx context.Context, request ThemeSearchRequest) (*ThemeSearchResponse, *Errors, error) {
  8000  	var resp ThemeSearchResponse
  8001  	var errors Errors
  8002  
  8003  	restClient := c.Start(&resp, &errors)
  8004  	err := restClient.WithUri("/api/theme/search").
  8005  		WithJSONBody(request).
  8006  		WithMethod(http.MethodPost).
  8007  		Do(ctx)
  8008  	if restClient.ErrorRef == nil {
  8009  		return &resp, nil, err
  8010  	}
  8011  	return &resp, &errors, err
  8012  }
  8013  
  8014  // SearchUserComments
  8015  // Searches user comments with the specified criteria and pagination.
  8016  //
  8017  //	UserCommentSearchRequest request The search criteria and pagination information.
  8018  func (c *FusionAuthClient) SearchUserComments(request UserCommentSearchRequest) (*UserCommentSearchResponse, *Errors, error) {
  8019  	return c.SearchUserCommentsWithContext(context.TODO(), request)
  8020  }
  8021  
  8022  // SearchUserCommentsWithContext
  8023  // Searches user comments with the specified criteria and pagination.
  8024  //
  8025  //	UserCommentSearchRequest request The search criteria and pagination information.
  8026  func (c *FusionAuthClient) SearchUserCommentsWithContext(ctx context.Context, request UserCommentSearchRequest) (*UserCommentSearchResponse, *Errors, error) {
  8027  	var resp UserCommentSearchResponse
  8028  	var errors Errors
  8029  
  8030  	restClient := c.Start(&resp, &errors)
  8031  	err := restClient.WithUri("/api/user/comment/search").
  8032  		WithJSONBody(request).
  8033  		WithMethod(http.MethodPost).
  8034  		Do(ctx)
  8035  	if restClient.ErrorRef == nil {
  8036  		return &resp, nil, err
  8037  	}
  8038  	return &resp, &errors, err
  8039  }
  8040  
  8041  // SearchUsers
  8042  // Retrieves the users for the given ids. If any Id is invalid, it is ignored.
  8043  //
  8044  //	[]string ids The user ids to search for.
  8045  //
  8046  // Deprecated: This method has been renamed to SearchUsersByIds, use that method instead.
  8047  func (c *FusionAuthClient) SearchUsers(ids []string) (*SearchResponse, *Errors, error) {
  8048  	return c.SearchUsersWithContext(context.TODO(), ids)
  8049  }
  8050  
  8051  // SearchUsersWithContext
  8052  // Retrieves the users for the given ids. If any Id is invalid, it is ignored.
  8053  //
  8054  //	[]string ids The user ids to search for.
  8055  //
  8056  // Deprecated: This method has been renamed to SearchUsersByIdsWithContext, use that method instead.
  8057  func (c *FusionAuthClient) SearchUsersWithContext(ctx context.Context, ids []string) (*SearchResponse, *Errors, error) {
  8058  	var resp SearchResponse
  8059  	var errors Errors
  8060  
  8061  	restClient := c.Start(&resp, &errors)
  8062  	err := restClient.WithUri("/api/user/search").
  8063  		WithParameter("ids", ids).
  8064  		WithMethod(http.MethodGet).
  8065  		Do(ctx)
  8066  	if restClient.ErrorRef == nil {
  8067  		return &resp, nil, err
  8068  	}
  8069  	return &resp, &errors, err
  8070  }
  8071  
  8072  // SearchUsersByIds
  8073  // Retrieves the users for the given ids. If any Id is invalid, it is ignored.
  8074  //
  8075  //	[]string ids The user ids to search for.
  8076  func (c *FusionAuthClient) SearchUsersByIds(ids []string) (*SearchResponse, *Errors, error) {
  8077  	return c.SearchUsersByIdsWithContext(context.TODO(), ids)
  8078  }
  8079  
  8080  // SearchUsersByIdsWithContext
  8081  // Retrieves the users for the given ids. If any Id is invalid, it is ignored.
  8082  //
  8083  //	[]string ids The user ids to search for.
  8084  func (c *FusionAuthClient) SearchUsersByIdsWithContext(ctx context.Context, ids []string) (*SearchResponse, *Errors, error) {
  8085  	var resp SearchResponse
  8086  	var errors Errors
  8087  
  8088  	restClient := c.Start(&resp, &errors)
  8089  	err := restClient.WithUri("/api/user/search").
  8090  		WithParameter("ids", ids).
  8091  		WithMethod(http.MethodGet).
  8092  		Do(ctx)
  8093  	if restClient.ErrorRef == nil {
  8094  		return &resp, nil, err
  8095  	}
  8096  	return &resp, &errors, err
  8097  }
  8098  
  8099  // SearchUsersByQuery
  8100  // Retrieves the users for the given search criteria and pagination.
  8101  //
  8102  //	SearchRequest request The search criteria and pagination constraints. Fields used: ids, query, queryString, numberOfResults, orderBy, startRow,
  8103  //	and sortFields.
  8104  func (c *FusionAuthClient) SearchUsersByQuery(request SearchRequest) (*SearchResponse, *Errors, error) {
  8105  	return c.SearchUsersByQueryWithContext(context.TODO(), request)
  8106  }
  8107  
  8108  // SearchUsersByQueryWithContext
  8109  // Retrieves the users for the given search criteria and pagination.
  8110  //
  8111  //	SearchRequest request The search criteria and pagination constraints. Fields used: ids, query, queryString, numberOfResults, orderBy, startRow,
  8112  //	and sortFields.
  8113  func (c *FusionAuthClient) SearchUsersByQueryWithContext(ctx context.Context, request SearchRequest) (*SearchResponse, *Errors, error) {
  8114  	var resp SearchResponse
  8115  	var errors Errors
  8116  
  8117  	restClient := c.Start(&resp, &errors)
  8118  	err := restClient.WithUri("/api/user/search").
  8119  		WithJSONBody(request).
  8120  		WithMethod(http.MethodPost).
  8121  		Do(ctx)
  8122  	if restClient.ErrorRef == nil {
  8123  		return &resp, nil, err
  8124  	}
  8125  	return &resp, &errors, err
  8126  }
  8127  
  8128  // SearchUsersByQueryString
  8129  // Retrieves the users for the given search criteria and pagination.
  8130  //
  8131  //	SearchRequest request The search criteria and pagination constraints. Fields used: ids, query, queryString, numberOfResults, orderBy, startRow,
  8132  //	and sortFields.
  8133  //
  8134  // Deprecated: This method has been renamed to SearchUsersByQuery, use that method instead.
  8135  func (c *FusionAuthClient) SearchUsersByQueryString(request SearchRequest) (*SearchResponse, *Errors, error) {
  8136  	return c.SearchUsersByQueryStringWithContext(context.TODO(), request)
  8137  }
  8138  
  8139  // SearchUsersByQueryStringWithContext
  8140  // Retrieves the users for the given search criteria and pagination.
  8141  //
  8142  //	SearchRequest request The search criteria and pagination constraints. Fields used: ids, query, queryString, numberOfResults, orderBy, startRow,
  8143  //	and sortFields.
  8144  //
  8145  // Deprecated: This method has been renamed to SearchUsersByQueryWithContext, use that method instead.
  8146  func (c *FusionAuthClient) SearchUsersByQueryStringWithContext(ctx context.Context, request SearchRequest) (*SearchResponse, *Errors, error) {
  8147  	var resp SearchResponse
  8148  	var errors Errors
  8149  
  8150  	restClient := c.Start(&resp, &errors)
  8151  	err := restClient.WithUri("/api/user/search").
  8152  		WithJSONBody(request).
  8153  		WithMethod(http.MethodPost).
  8154  		Do(ctx)
  8155  	if restClient.ErrorRef == nil {
  8156  		return &resp, nil, err
  8157  	}
  8158  	return &resp, &errors, err
  8159  }
  8160  
  8161  // SearchWebhooks
  8162  // Searches webhooks with the specified criteria and pagination.
  8163  //
  8164  //	WebhookSearchRequest request The search criteria and pagination information.
  8165  func (c *FusionAuthClient) SearchWebhooks(request WebhookSearchRequest) (*WebhookSearchResponse, *Errors, error) {
  8166  	return c.SearchWebhooksWithContext(context.TODO(), request)
  8167  }
  8168  
  8169  // SearchWebhooksWithContext
  8170  // Searches webhooks with the specified criteria and pagination.
  8171  //
  8172  //	WebhookSearchRequest request The search criteria and pagination information.
  8173  func (c *FusionAuthClient) SearchWebhooksWithContext(ctx context.Context, request WebhookSearchRequest) (*WebhookSearchResponse, *Errors, error) {
  8174  	var resp WebhookSearchResponse
  8175  	var errors Errors
  8176  
  8177  	restClient := c.Start(&resp, &errors)
  8178  	err := restClient.WithUri("/api/webhook/search").
  8179  		WithJSONBody(request).
  8180  		WithMethod(http.MethodPost).
  8181  		Do(ctx)
  8182  	if restClient.ErrorRef == nil {
  8183  		return &resp, nil, err
  8184  	}
  8185  	return &resp, &errors, err
  8186  }
  8187  
  8188  // SendEmail
  8189  // Send an email using an email template id. You can optionally provide <code>requestData</code> to access key value
  8190  // pairs in the email template.
  8191  //
  8192  //	string emailTemplateId The Id for the template.
  8193  //	SendRequest request The send email request that contains all the information used to send the email.
  8194  func (c *FusionAuthClient) SendEmail(emailTemplateId string, request SendRequest) (*SendResponse, *Errors, error) {
  8195  	return c.SendEmailWithContext(context.TODO(), emailTemplateId, request)
  8196  }
  8197  
  8198  // SendEmailWithContext
  8199  // Send an email using an email template id. You can optionally provide <code>requestData</code> to access key value
  8200  // pairs in the email template.
  8201  //
  8202  //	string emailTemplateId The Id for the template.
  8203  //	SendRequest request The send email request that contains all the information used to send the email.
  8204  func (c *FusionAuthClient) SendEmailWithContext(ctx context.Context, emailTemplateId string, request SendRequest) (*SendResponse, *Errors, error) {
  8205  	var resp SendResponse
  8206  	var errors Errors
  8207  
  8208  	restClient := c.Start(&resp, &errors)
  8209  	err := restClient.WithUri("/api/email/send").
  8210  		WithUriSegment(emailTemplateId).
  8211  		WithJSONBody(request).
  8212  		WithMethod(http.MethodPost).
  8213  		Do(ctx)
  8214  	if restClient.ErrorRef == nil {
  8215  		return &resp, nil, err
  8216  	}
  8217  	return &resp, &errors, err
  8218  }
  8219  
  8220  // SendFamilyRequestEmail
  8221  // Sends out an email to a parent that they need to register and create a family or need to log in and add a child to their existing family.
  8222  //
  8223  //	FamilyEmailRequest request The request object that contains the parent email.
  8224  func (c *FusionAuthClient) SendFamilyRequestEmail(request FamilyEmailRequest) (*BaseHTTPResponse, *Errors, error) {
  8225  	return c.SendFamilyRequestEmailWithContext(context.TODO(), request)
  8226  }
  8227  
  8228  // SendFamilyRequestEmailWithContext
  8229  // Sends out an email to a parent that they need to register and create a family or need to log in and add a child to their existing family.
  8230  //
  8231  //	FamilyEmailRequest request The request object that contains the parent email.
  8232  func (c *FusionAuthClient) SendFamilyRequestEmailWithContext(ctx context.Context, request FamilyEmailRequest) (*BaseHTTPResponse, *Errors, error) {
  8233  	var resp BaseHTTPResponse
  8234  	var errors Errors
  8235  
  8236  	restClient := c.Start(&resp, &errors)
  8237  	err := restClient.WithUri("/api/user/family/request").
  8238  		WithJSONBody(request).
  8239  		WithMethod(http.MethodPost).
  8240  		Do(ctx)
  8241  	if restClient.ErrorRef == nil {
  8242  		return &resp, nil, err
  8243  	}
  8244  	return &resp, &errors, err
  8245  }
  8246  
  8247  // SendPasswordlessCode
  8248  // Send a passwordless authentication code in an email to complete login.
  8249  //
  8250  //	PasswordlessSendRequest request The passwordless send request that contains all the information used to send an email containing a code.
  8251  func (c *FusionAuthClient) SendPasswordlessCode(request PasswordlessSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8252  	return c.SendPasswordlessCodeWithContext(context.TODO(), request)
  8253  }
  8254  
  8255  // SendPasswordlessCodeWithContext
  8256  // Send a passwordless authentication code in an email to complete login.
  8257  //
  8258  //	PasswordlessSendRequest request The passwordless send request that contains all the information used to send an email containing a code.
  8259  func (c *FusionAuthClient) SendPasswordlessCodeWithContext(ctx context.Context, request PasswordlessSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8260  	var resp BaseHTTPResponse
  8261  	var errors Errors
  8262  
  8263  	restClient := c.StartAnonymous(&resp, &errors)
  8264  	err := restClient.WithUri("/api/passwordless/send").
  8265  		WithJSONBody(request).
  8266  		WithMethod(http.MethodPost).
  8267  		Do(ctx)
  8268  	if restClient.ErrorRef == nil {
  8269  		return &resp, nil, err
  8270  	}
  8271  	return &resp, &errors, err
  8272  }
  8273  
  8274  // SendTwoFactorCode
  8275  // Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
  8276  //
  8277  //	TwoFactorSendRequest request The request object that contains all the information used to send the code.
  8278  //
  8279  // Deprecated: This method has been renamed to SendTwoFactorCodeForEnableDisable, use that method instead.
  8280  func (c *FusionAuthClient) SendTwoFactorCode(request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8281  	return c.SendTwoFactorCodeWithContext(context.TODO(), request)
  8282  }
  8283  
  8284  // SendTwoFactorCodeWithContext
  8285  // Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
  8286  //
  8287  //	TwoFactorSendRequest request The request object that contains all the information used to send the code.
  8288  //
  8289  // Deprecated: This method has been renamed to SendTwoFactorCodeForEnableDisableWithContext, use that method instead.
  8290  func (c *FusionAuthClient) SendTwoFactorCodeWithContext(ctx context.Context, request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8291  	var resp BaseHTTPResponse
  8292  	var errors Errors
  8293  
  8294  	restClient := c.Start(&resp, &errors)
  8295  	err := restClient.WithUri("/api/two-factor/send").
  8296  		WithJSONBody(request).
  8297  		WithMethod(http.MethodPost).
  8298  		Do(ctx)
  8299  	if restClient.ErrorRef == nil {
  8300  		return &resp, nil, err
  8301  	}
  8302  	return &resp, &errors, err
  8303  }
  8304  
  8305  // SendTwoFactorCodeForEnableDisable
  8306  // Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
  8307  //
  8308  //	TwoFactorSendRequest request The request object that contains all the information used to send the code.
  8309  func (c *FusionAuthClient) SendTwoFactorCodeForEnableDisable(request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8310  	return c.SendTwoFactorCodeForEnableDisableWithContext(context.TODO(), request)
  8311  }
  8312  
  8313  // SendTwoFactorCodeForEnableDisableWithContext
  8314  // Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling.
  8315  //
  8316  //	TwoFactorSendRequest request The request object that contains all the information used to send the code.
  8317  func (c *FusionAuthClient) SendTwoFactorCodeForEnableDisableWithContext(ctx context.Context, request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8318  	var resp BaseHTTPResponse
  8319  	var errors Errors
  8320  
  8321  	restClient := c.Start(&resp, &errors)
  8322  	err := restClient.WithUri("/api/two-factor/send").
  8323  		WithJSONBody(request).
  8324  		WithMethod(http.MethodPost).
  8325  		Do(ctx)
  8326  	if restClient.ErrorRef == nil {
  8327  		return &resp, nil, err
  8328  	}
  8329  	return &resp, &errors, err
  8330  }
  8331  
  8332  // SendTwoFactorCodeForLogin
  8333  // Send a Two Factor authentication code to allow the completion of Two Factor authentication.
  8334  //
  8335  //	string twoFactorId The Id returned by the Login API necessary to complete Two Factor authentication.
  8336  //
  8337  // Deprecated: This method has been renamed to SendTwoFactorCodeForLoginUsingMethod, use that method instead.
  8338  func (c *FusionAuthClient) SendTwoFactorCodeForLogin(twoFactorId string) (*BaseHTTPResponse, *Errors, error) {
  8339  	return c.SendTwoFactorCodeForLoginWithContext(context.TODO(), twoFactorId)
  8340  }
  8341  
  8342  // SendTwoFactorCodeForLoginWithContext
  8343  // Send a Two Factor authentication code to allow the completion of Two Factor authentication.
  8344  //
  8345  //	string twoFactorId The Id returned by the Login API necessary to complete Two Factor authentication.
  8346  //
  8347  // Deprecated: This method has been renamed to SendTwoFactorCodeForLoginUsingMethodWithContext, use that method instead.
  8348  func (c *FusionAuthClient) SendTwoFactorCodeForLoginWithContext(ctx context.Context, twoFactorId string) (*BaseHTTPResponse, *Errors, error) {
  8349  	var resp BaseHTTPResponse
  8350  	var errors Errors
  8351  
  8352  	restClient := c.StartAnonymous(&resp, &errors)
  8353  	err := restClient.WithUri("/api/two-factor/send").
  8354  		WithUriSegment(twoFactorId).
  8355  		WithMethod(http.MethodPost).
  8356  		Do(ctx)
  8357  	if restClient.ErrorRef == nil {
  8358  		return &resp, nil, err
  8359  	}
  8360  	return &resp, &errors, err
  8361  }
  8362  
  8363  // SendTwoFactorCodeForLoginUsingMethod
  8364  // Send a Two Factor authentication code to allow the completion of Two Factor authentication.
  8365  //
  8366  //	string twoFactorId The Id returned by the Login API necessary to complete Two Factor authentication.
  8367  //	TwoFactorSendRequest request The Two Factor send request that contains all the information used to send the Two Factor code to the user.
  8368  func (c *FusionAuthClient) SendTwoFactorCodeForLoginUsingMethod(twoFactorId string, request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8369  	return c.SendTwoFactorCodeForLoginUsingMethodWithContext(context.TODO(), twoFactorId, request)
  8370  }
  8371  
  8372  // SendTwoFactorCodeForLoginUsingMethodWithContext
  8373  // Send a Two Factor authentication code to allow the completion of Two Factor authentication.
  8374  //
  8375  //	string twoFactorId The Id returned by the Login API necessary to complete Two Factor authentication.
  8376  //	TwoFactorSendRequest request The Two Factor send request that contains all the information used to send the Two Factor code to the user.
  8377  func (c *FusionAuthClient) SendTwoFactorCodeForLoginUsingMethodWithContext(ctx context.Context, twoFactorId string, request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) {
  8378  	var resp BaseHTTPResponse
  8379  	var errors Errors
  8380  
  8381  	restClient := c.StartAnonymous(&resp, &errors)
  8382  	err := restClient.WithUri("/api/two-factor/send").
  8383  		WithUriSegment(twoFactorId).
  8384  		WithJSONBody(request).
  8385  		WithMethod(http.MethodPost).
  8386  		Do(ctx)
  8387  	if restClient.ErrorRef == nil {
  8388  		return &resp, nil, err
  8389  	}
  8390  	return &resp, &errors, err
  8391  }
  8392  
  8393  // StartIdentityProviderLogin
  8394  // Begins a login request for a 3rd party login that requires user interaction such as HYPR.
  8395  //
  8396  //	IdentityProviderStartLoginRequest request The third-party login request that contains information from the third-party login
  8397  //	providers that FusionAuth uses to reconcile the user's account.
  8398  func (c *FusionAuthClient) StartIdentityProviderLogin(request IdentityProviderStartLoginRequest) (*IdentityProviderStartLoginResponse, *Errors, error) {
  8399  	return c.StartIdentityProviderLoginWithContext(context.TODO(), request)
  8400  }
  8401  
  8402  // StartIdentityProviderLoginWithContext
  8403  // Begins a login request for a 3rd party login that requires user interaction such as HYPR.
  8404  //
  8405  //	IdentityProviderStartLoginRequest request The third-party login request that contains information from the third-party login
  8406  //	providers that FusionAuth uses to reconcile the user's account.
  8407  func (c *FusionAuthClient) StartIdentityProviderLoginWithContext(ctx context.Context, request IdentityProviderStartLoginRequest) (*IdentityProviderStartLoginResponse, *Errors, error) {
  8408  	var resp IdentityProviderStartLoginResponse
  8409  	var errors Errors
  8410  
  8411  	restClient := c.Start(&resp, &errors)
  8412  	err := restClient.WithUri("/api/identity-provider/start").
  8413  		WithJSONBody(request).
  8414  		WithMethod(http.MethodPost).
  8415  		Do(ctx)
  8416  	if restClient.ErrorRef == nil {
  8417  		return &resp, nil, err
  8418  	}
  8419  	return &resp, &errors, err
  8420  }
  8421  
  8422  // StartPasswordlessLogin
  8423  // Start a passwordless login request by generating a passwordless code. This code can be sent to the User using the Send
  8424  // Passwordless Code API or using a mechanism outside of FusionAuth. The passwordless login is completed by using the Passwordless Login API with this code.
  8425  //
  8426  //	PasswordlessStartRequest request The passwordless start request that contains all the information used to begin the passwordless login request.
  8427  func (c *FusionAuthClient) StartPasswordlessLogin(request PasswordlessStartRequest) (*PasswordlessStartResponse, *Errors, error) {
  8428  	return c.StartPasswordlessLoginWithContext(context.TODO(), request)
  8429  }
  8430  
  8431  // StartPasswordlessLoginWithContext
  8432  // Start a passwordless login request by generating a passwordless code. This code can be sent to the User using the Send
  8433  // Passwordless Code API or using a mechanism outside of FusionAuth. The passwordless login is completed by using the Passwordless Login API with this code.
  8434  //
  8435  //	PasswordlessStartRequest request The passwordless start request that contains all the information used to begin the passwordless login request.
  8436  func (c *FusionAuthClient) StartPasswordlessLoginWithContext(ctx context.Context, request PasswordlessStartRequest) (*PasswordlessStartResponse, *Errors, error) {
  8437  	var resp PasswordlessStartResponse
  8438  	var errors Errors
  8439  
  8440  	restClient := c.Start(&resp, &errors)
  8441  	err := restClient.WithUri("/api/passwordless/start").
  8442  		WithJSONBody(request).
  8443  		WithMethod(http.MethodPost).
  8444  		Do(ctx)
  8445  	if restClient.ErrorRef == nil {
  8446  		return &resp, nil, err
  8447  	}
  8448  	return &resp, &errors, err
  8449  }
  8450  
  8451  // StartTwoFactorLogin
  8452  // Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send
  8453  // API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned
  8454  // to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login
  8455  // API (/api/two-factor/login). with the two-factor identifier and the one-time use code.
  8456  //
  8457  // This API is intended to allow you to begin a Two-Factor login outside a normal login that originated from the Login API (/api/login).
  8458  //
  8459  //	TwoFactorStartRequest request The Two-Factor start request that contains all the information used to begin the Two-Factor login request.
  8460  func (c *FusionAuthClient) StartTwoFactorLogin(request TwoFactorStartRequest) (*TwoFactorStartResponse, *Errors, error) {
  8461  	return c.StartTwoFactorLoginWithContext(context.TODO(), request)
  8462  }
  8463  
  8464  // StartTwoFactorLoginWithContext
  8465  // Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send
  8466  // API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned
  8467  // to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login
  8468  // API (/api/two-factor/login). with the two-factor identifier and the one-time use code.
  8469  //
  8470  // This API is intended to allow you to begin a Two-Factor login outside a normal login that originated from the Login API (/api/login).
  8471  //
  8472  //	TwoFactorStartRequest request The Two-Factor start request that contains all the information used to begin the Two-Factor login request.
  8473  func (c *FusionAuthClient) StartTwoFactorLoginWithContext(ctx context.Context, request TwoFactorStartRequest) (*TwoFactorStartResponse, *Errors, error) {
  8474  	var resp TwoFactorStartResponse
  8475  	var errors Errors
  8476  
  8477  	restClient := c.Start(&resp, &errors)
  8478  	err := restClient.WithUri("/api/two-factor/start").
  8479  		WithJSONBody(request).
  8480  		WithMethod(http.MethodPost).
  8481  		Do(ctx)
  8482  	if restClient.ErrorRef == nil {
  8483  		return &resp, nil, err
  8484  	}
  8485  	return &resp, &errors, err
  8486  }
  8487  
  8488  // StartWebAuthnLogin
  8489  // Start a WebAuthn authentication ceremony by generating a new challenge for the user
  8490  //
  8491  //	WebAuthnStartRequest request An object containing data necessary for starting the authentication ceremony
  8492  func (c *FusionAuthClient) StartWebAuthnLogin(request WebAuthnStartRequest) (*WebAuthnStartResponse, *Errors, error) {
  8493  	return c.StartWebAuthnLoginWithContext(context.TODO(), request)
  8494  }
  8495  
  8496  // StartWebAuthnLoginWithContext
  8497  // Start a WebAuthn authentication ceremony by generating a new challenge for the user
  8498  //
  8499  //	WebAuthnStartRequest request An object containing data necessary for starting the authentication ceremony
  8500  func (c *FusionAuthClient) StartWebAuthnLoginWithContext(ctx context.Context, request WebAuthnStartRequest) (*WebAuthnStartResponse, *Errors, error) {
  8501  	var resp WebAuthnStartResponse
  8502  	var errors Errors
  8503  
  8504  	restClient := c.Start(&resp, &errors)
  8505  	err := restClient.WithUri("/api/webauthn/start").
  8506  		WithJSONBody(request).
  8507  		WithMethod(http.MethodPost).
  8508  		Do(ctx)
  8509  	if restClient.ErrorRef == nil {
  8510  		return &resp, nil, err
  8511  	}
  8512  	return &resp, &errors, err
  8513  }
  8514  
  8515  // StartWebAuthnRegistration
  8516  // Start a WebAuthn registration ceremony by generating a new challenge for the user
  8517  //
  8518  //	WebAuthnRegisterStartRequest request An object containing data necessary for starting the registration ceremony
  8519  func (c *FusionAuthClient) StartWebAuthnRegistration(request WebAuthnRegisterStartRequest) (*WebAuthnRegisterStartResponse, *Errors, error) {
  8520  	return c.StartWebAuthnRegistrationWithContext(context.TODO(), request)
  8521  }
  8522  
  8523  // StartWebAuthnRegistrationWithContext
  8524  // Start a WebAuthn registration ceremony by generating a new challenge for the user
  8525  //
  8526  //	WebAuthnRegisterStartRequest request An object containing data necessary for starting the registration ceremony
  8527  func (c *FusionAuthClient) StartWebAuthnRegistrationWithContext(ctx context.Context, request WebAuthnRegisterStartRequest) (*WebAuthnRegisterStartResponse, *Errors, error) {
  8528  	var resp WebAuthnRegisterStartResponse
  8529  	var errors Errors
  8530  
  8531  	restClient := c.Start(&resp, &errors)
  8532  	err := restClient.WithUri("/api/webauthn/register/start").
  8533  		WithJSONBody(request).
  8534  		WithMethod(http.MethodPost).
  8535  		Do(ctx)
  8536  	if restClient.ErrorRef == nil {
  8537  		return &resp, nil, err
  8538  	}
  8539  	return &resp, &errors, err
  8540  }
  8541  
  8542  // TwoFactorLogin
  8543  // Complete login using a 2FA challenge
  8544  //
  8545  //	TwoFactorLoginRequest request The login request that contains the user credentials used to log them in.
  8546  func (c *FusionAuthClient) TwoFactorLogin(request TwoFactorLoginRequest) (*LoginResponse, *Errors, error) {
  8547  	return c.TwoFactorLoginWithContext(context.TODO(), request)
  8548  }
  8549  
  8550  // TwoFactorLoginWithContext
  8551  // Complete login using a 2FA challenge
  8552  //
  8553  //	TwoFactorLoginRequest request The login request that contains the user credentials used to log them in.
  8554  func (c *FusionAuthClient) TwoFactorLoginWithContext(ctx context.Context, request TwoFactorLoginRequest) (*LoginResponse, *Errors, error) {
  8555  	var resp LoginResponse
  8556  	var errors Errors
  8557  
  8558  	restClient := c.StartAnonymous(&resp, &errors)
  8559  	err := restClient.WithUri("/api/two-factor/login").
  8560  		WithJSONBody(request).
  8561  		WithMethod(http.MethodPost).
  8562  		Do(ctx)
  8563  	if restClient.ErrorRef == nil {
  8564  		return &resp, nil, err
  8565  	}
  8566  	return &resp, &errors, err
  8567  }
  8568  
  8569  // UpdateAPIKey
  8570  // Updates an API key by given id
  8571  //
  8572  //	string apiKeyId The Id of the API key to update.
  8573  //	APIKeyRequest request The request object that contains all the information used to create the API Key.
  8574  func (c *FusionAuthClient) UpdateAPIKey(apiKeyId string, request APIKeyRequest) (*APIKeyResponse, *Errors, error) {
  8575  	return c.UpdateAPIKeyWithContext(context.TODO(), apiKeyId, request)
  8576  }
  8577  
  8578  // UpdateAPIKeyWithContext
  8579  // Updates an API key by given id
  8580  //
  8581  //	string apiKeyId The Id of the API key to update.
  8582  //	APIKeyRequest request The request object that contains all the information used to create the API Key.
  8583  func (c *FusionAuthClient) UpdateAPIKeyWithContext(ctx context.Context, apiKeyId string, request APIKeyRequest) (*APIKeyResponse, *Errors, error) {
  8584  	var resp APIKeyResponse
  8585  	var errors Errors
  8586  
  8587  	restClient := c.Start(&resp, &errors)
  8588  	err := restClient.WithUri("/api/api-key").
  8589  		WithUriSegment(apiKeyId).
  8590  		WithJSONBody(request).
  8591  		WithMethod(http.MethodPut).
  8592  		Do(ctx)
  8593  	if restClient.ErrorRef == nil {
  8594  		return &resp, nil, err
  8595  	}
  8596  	return &resp, &errors, err
  8597  }
  8598  
  8599  // UpdateApplication
  8600  // Updates the application with the given Id.
  8601  //
  8602  //	string applicationId The Id of the application to update.
  8603  //	ApplicationRequest request The request that contains all the new application information.
  8604  func (c *FusionAuthClient) UpdateApplication(applicationId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
  8605  	return c.UpdateApplicationWithContext(context.TODO(), applicationId, request)
  8606  }
  8607  
  8608  // UpdateApplicationWithContext
  8609  // Updates the application with the given Id.
  8610  //
  8611  //	string applicationId The Id of the application to update.
  8612  //	ApplicationRequest request The request that contains all the new application information.
  8613  func (c *FusionAuthClient) UpdateApplicationWithContext(ctx context.Context, applicationId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
  8614  	var resp ApplicationResponse
  8615  	var errors Errors
  8616  
  8617  	restClient := c.Start(&resp, &errors)
  8618  	err := restClient.WithUri("/api/application").
  8619  		WithUriSegment(applicationId).
  8620  		WithJSONBody(request).
  8621  		WithMethod(http.MethodPut).
  8622  		Do(ctx)
  8623  	if restClient.ErrorRef == nil {
  8624  		return &resp, nil, err
  8625  	}
  8626  	return &resp, &errors, err
  8627  }
  8628  
  8629  // UpdateApplicationRole
  8630  // Updates the application role with the given Id for the application.
  8631  //
  8632  //	string applicationId The Id of the application that the role belongs to.
  8633  //	string roleId The Id of the role to update.
  8634  //	ApplicationRequest request The request that contains all the new role information.
  8635  func (c *FusionAuthClient) UpdateApplicationRole(applicationId string, roleId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
  8636  	return c.UpdateApplicationRoleWithContext(context.TODO(), applicationId, roleId, request)
  8637  }
  8638  
  8639  // UpdateApplicationRoleWithContext
  8640  // Updates the application role with the given Id for the application.
  8641  //
  8642  //	string applicationId The Id of the application that the role belongs to.
  8643  //	string roleId The Id of the role to update.
  8644  //	ApplicationRequest request The request that contains all the new role information.
  8645  func (c *FusionAuthClient) UpdateApplicationRoleWithContext(ctx context.Context, applicationId string, roleId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) {
  8646  	var resp ApplicationResponse
  8647  	var errors Errors
  8648  
  8649  	restClient := c.Start(&resp, &errors)
  8650  	err := restClient.WithUri("/api/application").
  8651  		WithUriSegment(applicationId).
  8652  		WithUriSegment("role").
  8653  		WithUriSegment(roleId).
  8654  		WithJSONBody(request).
  8655  		WithMethod(http.MethodPut).
  8656  		Do(ctx)
  8657  	if restClient.ErrorRef == nil {
  8658  		return &resp, nil, err
  8659  	}
  8660  	return &resp, &errors, err
  8661  }
  8662  
  8663  // UpdateConnector
  8664  // Updates the connector with the given Id.
  8665  //
  8666  //	string connectorId The Id of the connector to update.
  8667  //	ConnectorRequest request The request object that contains all the new connector information.
  8668  func (c *FusionAuthClient) UpdateConnector(connectorId string, request ConnectorRequest) (*ConnectorResponse, *Errors, error) {
  8669  	return c.UpdateConnectorWithContext(context.TODO(), connectorId, request)
  8670  }
  8671  
  8672  // UpdateConnectorWithContext
  8673  // Updates the connector with the given Id.
  8674  //
  8675  //	string connectorId The Id of the connector to update.
  8676  //	ConnectorRequest request The request object that contains all the new connector information.
  8677  func (c *FusionAuthClient) UpdateConnectorWithContext(ctx context.Context, connectorId string, request ConnectorRequest) (*ConnectorResponse, *Errors, error) {
  8678  	var resp ConnectorResponse
  8679  	var errors Errors
  8680  
  8681  	restClient := c.Start(&resp, &errors)
  8682  	err := restClient.WithUri("/api/connector").
  8683  		WithUriSegment(connectorId).
  8684  		WithJSONBody(request).
  8685  		WithMethod(http.MethodPut).
  8686  		Do(ctx)
  8687  	if restClient.ErrorRef == nil {
  8688  		return &resp, nil, err
  8689  	}
  8690  	return &resp, &errors, err
  8691  }
  8692  
  8693  // UpdateConsent
  8694  // Updates the consent with the given Id.
  8695  //
  8696  //	string consentId The Id of the consent to update.
  8697  //	ConsentRequest request The request that contains all the new consent information.
  8698  func (c *FusionAuthClient) UpdateConsent(consentId string, request ConsentRequest) (*ConsentResponse, *Errors, error) {
  8699  	return c.UpdateConsentWithContext(context.TODO(), consentId, request)
  8700  }
  8701  
  8702  // UpdateConsentWithContext
  8703  // Updates the consent with the given Id.
  8704  //
  8705  //	string consentId The Id of the consent to update.
  8706  //	ConsentRequest request The request that contains all the new consent information.
  8707  func (c *FusionAuthClient) UpdateConsentWithContext(ctx context.Context, consentId string, request ConsentRequest) (*ConsentResponse, *Errors, error) {
  8708  	var resp ConsentResponse
  8709  	var errors Errors
  8710  
  8711  	restClient := c.Start(&resp, &errors)
  8712  	err := restClient.WithUri("/api/consent").
  8713  		WithUriSegment(consentId).
  8714  		WithJSONBody(request).
  8715  		WithMethod(http.MethodPut).
  8716  		Do(ctx)
  8717  	if restClient.ErrorRef == nil {
  8718  		return &resp, nil, err
  8719  	}
  8720  	return &resp, &errors, err
  8721  }
  8722  
  8723  // UpdateEmailTemplate
  8724  // Updates the email template with the given Id.
  8725  //
  8726  //	string emailTemplateId The Id of the email template to update.
  8727  //	EmailTemplateRequest request The request that contains all the new email template information.
  8728  func (c *FusionAuthClient) UpdateEmailTemplate(emailTemplateId string, request EmailTemplateRequest) (*EmailTemplateResponse, *Errors, error) {
  8729  	return c.UpdateEmailTemplateWithContext(context.TODO(), emailTemplateId, request)
  8730  }
  8731  
  8732  // UpdateEmailTemplateWithContext
  8733  // Updates the email template with the given Id.
  8734  //
  8735  //	string emailTemplateId The Id of the email template to update.
  8736  //	EmailTemplateRequest request The request that contains all the new email template information.
  8737  func (c *FusionAuthClient) UpdateEmailTemplateWithContext(ctx context.Context, emailTemplateId string, request EmailTemplateRequest) (*EmailTemplateResponse, *Errors, error) {
  8738  	var resp EmailTemplateResponse
  8739  	var errors Errors
  8740  
  8741  	restClient := c.Start(&resp, &errors)
  8742  	err := restClient.WithUri("/api/email/template").
  8743  		WithUriSegment(emailTemplateId).
  8744  		WithJSONBody(request).
  8745  		WithMethod(http.MethodPut).
  8746  		Do(ctx)
  8747  	if restClient.ErrorRef == nil {
  8748  		return &resp, nil, err
  8749  	}
  8750  	return &resp, &errors, err
  8751  }
  8752  
  8753  // UpdateEntity
  8754  // Updates the Entity with the given Id.
  8755  //
  8756  //	string entityId The Id of the Entity to update.
  8757  //	EntityRequest request The request that contains all the new Entity information.
  8758  func (c *FusionAuthClient) UpdateEntity(entityId string, request EntityRequest) (*EntityResponse, *Errors, error) {
  8759  	return c.UpdateEntityWithContext(context.TODO(), entityId, request)
  8760  }
  8761  
  8762  // UpdateEntityWithContext
  8763  // Updates the Entity with the given Id.
  8764  //
  8765  //	string entityId The Id of the Entity to update.
  8766  //	EntityRequest request The request that contains all the new Entity information.
  8767  func (c *FusionAuthClient) UpdateEntityWithContext(ctx context.Context, entityId string, request EntityRequest) (*EntityResponse, *Errors, error) {
  8768  	var resp EntityResponse
  8769  	var errors Errors
  8770  
  8771  	restClient := c.Start(&resp, &errors)
  8772  	err := restClient.WithUri("/api/entity").
  8773  		WithUriSegment(entityId).
  8774  		WithJSONBody(request).
  8775  		WithMethod(http.MethodPut).
  8776  		Do(ctx)
  8777  	if restClient.ErrorRef == nil {
  8778  		return &resp, nil, err
  8779  	}
  8780  	return &resp, &errors, err
  8781  }
  8782  
  8783  // UpdateEntityType
  8784  // Updates the Entity Type with the given Id.
  8785  //
  8786  //	string entityTypeId The Id of the Entity Type to update.
  8787  //	EntityTypeRequest request The request that contains all the new Entity Type information.
  8788  func (c *FusionAuthClient) UpdateEntityType(entityTypeId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
  8789  	return c.UpdateEntityTypeWithContext(context.TODO(), entityTypeId, request)
  8790  }
  8791  
  8792  // UpdateEntityTypeWithContext
  8793  // Updates the Entity Type with the given Id.
  8794  //
  8795  //	string entityTypeId The Id of the Entity Type to update.
  8796  //	EntityTypeRequest request The request that contains all the new Entity Type information.
  8797  func (c *FusionAuthClient) UpdateEntityTypeWithContext(ctx context.Context, entityTypeId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
  8798  	var resp EntityTypeResponse
  8799  	var errors Errors
  8800  
  8801  	restClient := c.Start(&resp, &errors)
  8802  	err := restClient.WithUri("/api/entity/type").
  8803  		WithUriSegment(entityTypeId).
  8804  		WithJSONBody(request).
  8805  		WithMethod(http.MethodPut).
  8806  		Do(ctx)
  8807  	if restClient.ErrorRef == nil {
  8808  		return &resp, nil, err
  8809  	}
  8810  	return &resp, &errors, err
  8811  }
  8812  
  8813  // UpdateEntityTypePermission
  8814  // Updates the permission with the given Id for the entity type.
  8815  //
  8816  //	string entityTypeId The Id of the entityType that the permission belongs to.
  8817  //	string permissionId The Id of the permission to update.
  8818  //	EntityTypeRequest request The request that contains all the new permission information.
  8819  func (c *FusionAuthClient) UpdateEntityTypePermission(entityTypeId string, permissionId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
  8820  	return c.UpdateEntityTypePermissionWithContext(context.TODO(), entityTypeId, permissionId, request)
  8821  }
  8822  
  8823  // UpdateEntityTypePermissionWithContext
  8824  // Updates the permission with the given Id for the entity type.
  8825  //
  8826  //	string entityTypeId The Id of the entityType that the permission belongs to.
  8827  //	string permissionId The Id of the permission to update.
  8828  //	EntityTypeRequest request The request that contains all the new permission information.
  8829  func (c *FusionAuthClient) UpdateEntityTypePermissionWithContext(ctx context.Context, entityTypeId string, permissionId string, request EntityTypeRequest) (*EntityTypeResponse, *Errors, error) {
  8830  	var resp EntityTypeResponse
  8831  	var errors Errors
  8832  
  8833  	restClient := c.Start(&resp, &errors)
  8834  	err := restClient.WithUri("/api/entity/type").
  8835  		WithUriSegment(entityTypeId).
  8836  		WithUriSegment("permission").
  8837  		WithUriSegment(permissionId).
  8838  		WithJSONBody(request).
  8839  		WithMethod(http.MethodPut).
  8840  		Do(ctx)
  8841  	if restClient.ErrorRef == nil {
  8842  		return &resp, nil, err
  8843  	}
  8844  	return &resp, &errors, err
  8845  }
  8846  
  8847  // UpdateForm
  8848  // Updates the form with the given Id.
  8849  //
  8850  //	string formId The Id of the form to update.
  8851  //	FormRequest request The request object that contains all the new form information.
  8852  func (c *FusionAuthClient) UpdateForm(formId string, request FormRequest) (*FormResponse, *Errors, error) {
  8853  	return c.UpdateFormWithContext(context.TODO(), formId, request)
  8854  }
  8855  
  8856  // UpdateFormWithContext
  8857  // Updates the form with the given Id.
  8858  //
  8859  //	string formId The Id of the form to update.
  8860  //	FormRequest request The request object that contains all the new form information.
  8861  func (c *FusionAuthClient) UpdateFormWithContext(ctx context.Context, formId string, request FormRequest) (*FormResponse, *Errors, error) {
  8862  	var resp FormResponse
  8863  	var errors Errors
  8864  
  8865  	restClient := c.Start(&resp, &errors)
  8866  	err := restClient.WithUri("/api/form").
  8867  		WithUriSegment(formId).
  8868  		WithJSONBody(request).
  8869  		WithMethod(http.MethodPut).
  8870  		Do(ctx)
  8871  	if restClient.ErrorRef == nil {
  8872  		return &resp, nil, err
  8873  	}
  8874  	return &resp, &errors, err
  8875  }
  8876  
  8877  // UpdateFormField
  8878  // Updates the form field with the given Id.
  8879  //
  8880  //	string fieldId The Id of the form field to update.
  8881  //	FormFieldRequest request The request object that contains all the new form field information.
  8882  func (c *FusionAuthClient) UpdateFormField(fieldId string, request FormFieldRequest) (*FormFieldResponse, *Errors, error) {
  8883  	return c.UpdateFormFieldWithContext(context.TODO(), fieldId, request)
  8884  }
  8885  
  8886  // UpdateFormFieldWithContext
  8887  // Updates the form field with the given Id.
  8888  //
  8889  //	string fieldId The Id of the form field to update.
  8890  //	FormFieldRequest request The request object that contains all the new form field information.
  8891  func (c *FusionAuthClient) UpdateFormFieldWithContext(ctx context.Context, fieldId string, request FormFieldRequest) (*FormFieldResponse, *Errors, error) {
  8892  	var resp FormFieldResponse
  8893  	var errors Errors
  8894  
  8895  	restClient := c.Start(&resp, &errors)
  8896  	err := restClient.WithUri("/api/form/field").
  8897  		WithUriSegment(fieldId).
  8898  		WithJSONBody(request).
  8899  		WithMethod(http.MethodPut).
  8900  		Do(ctx)
  8901  	if restClient.ErrorRef == nil {
  8902  		return &resp, nil, err
  8903  	}
  8904  	return &resp, &errors, err
  8905  }
  8906  
  8907  // UpdateGroup
  8908  // Updates the group with the given Id.
  8909  //
  8910  //	string groupId The Id of the group to update.
  8911  //	GroupRequest request The request that contains all the new group information.
  8912  func (c *FusionAuthClient) UpdateGroup(groupId string, request GroupRequest) (*GroupResponse, *Errors, error) {
  8913  	return c.UpdateGroupWithContext(context.TODO(), groupId, request)
  8914  }
  8915  
  8916  // UpdateGroupWithContext
  8917  // Updates the group with the given Id.
  8918  //
  8919  //	string groupId The Id of the group to update.
  8920  //	GroupRequest request The request that contains all the new group information.
  8921  func (c *FusionAuthClient) UpdateGroupWithContext(ctx context.Context, groupId string, request GroupRequest) (*GroupResponse, *Errors, error) {
  8922  	var resp GroupResponse
  8923  	var errors Errors
  8924  
  8925  	restClient := c.Start(&resp, &errors)
  8926  	err := restClient.WithUri("/api/group").
  8927  		WithUriSegment(groupId).
  8928  		WithJSONBody(request).
  8929  		WithMethod(http.MethodPut).
  8930  		Do(ctx)
  8931  	if restClient.ErrorRef == nil {
  8932  		return &resp, nil, err
  8933  	}
  8934  	return &resp, &errors, err
  8935  }
  8936  
  8937  // UpdateGroupMembers
  8938  // Creates a member in a group.
  8939  //
  8940  //	MemberRequest request The request object that contains all the information used to create the group member(s).
  8941  func (c *FusionAuthClient) UpdateGroupMembers(request MemberRequest) (*MemberResponse, *Errors, error) {
  8942  	return c.UpdateGroupMembersWithContext(context.TODO(), request)
  8943  }
  8944  
  8945  // UpdateGroupMembersWithContext
  8946  // Creates a member in a group.
  8947  //
  8948  //	MemberRequest request The request object that contains all the information used to create the group member(s).
  8949  func (c *FusionAuthClient) UpdateGroupMembersWithContext(ctx context.Context, request MemberRequest) (*MemberResponse, *Errors, error) {
  8950  	var resp MemberResponse
  8951  	var errors Errors
  8952  
  8953  	restClient := c.Start(&resp, &errors)
  8954  	err := restClient.WithUri("/api/group/member").
  8955  		WithJSONBody(request).
  8956  		WithMethod(http.MethodPut).
  8957  		Do(ctx)
  8958  	if restClient.ErrorRef == nil {
  8959  		return &resp, nil, err
  8960  	}
  8961  	return &resp, &errors, err
  8962  }
  8963  
  8964  // UpdateIPAccessControlList
  8965  // Updates the IP Access Control List with the given Id.
  8966  //
  8967  //	string accessControlListId The Id of the IP Access Control List to update.
  8968  //	IPAccessControlListRequest request The request that contains all the new IP Access Control List information.
  8969  func (c *FusionAuthClient) UpdateIPAccessControlList(accessControlListId string, request IPAccessControlListRequest) (*IPAccessControlListResponse, *Errors, error) {
  8970  	return c.UpdateIPAccessControlListWithContext(context.TODO(), accessControlListId, request)
  8971  }
  8972  
  8973  // UpdateIPAccessControlListWithContext
  8974  // Updates the IP Access Control List with the given Id.
  8975  //
  8976  //	string accessControlListId The Id of the IP Access Control List to update.
  8977  //	IPAccessControlListRequest request The request that contains all the new IP Access Control List information.
  8978  func (c *FusionAuthClient) UpdateIPAccessControlListWithContext(ctx context.Context, accessControlListId string, request IPAccessControlListRequest) (*IPAccessControlListResponse, *Errors, error) {
  8979  	var resp IPAccessControlListResponse
  8980  	var errors Errors
  8981  
  8982  	restClient := c.Start(&resp, &errors)
  8983  	err := restClient.WithUri("/api/ip-acl").
  8984  		WithUriSegment(accessControlListId).
  8985  		WithJSONBody(request).
  8986  		WithMethod(http.MethodPut).
  8987  		Do(ctx)
  8988  	if restClient.ErrorRef == nil {
  8989  		return &resp, nil, err
  8990  	}
  8991  	return &resp, &errors, err
  8992  }
  8993  
  8994  // UpdateIntegrations
  8995  // Updates the available integrations.
  8996  //
  8997  //	IntegrationRequest request The request that contains all the new integration information.
  8998  func (c *FusionAuthClient) UpdateIntegrations(request IntegrationRequest) (*IntegrationResponse, *Errors, error) {
  8999  	return c.UpdateIntegrationsWithContext(context.TODO(), request)
  9000  }
  9001  
  9002  // UpdateIntegrationsWithContext
  9003  // Updates the available integrations.
  9004  //
  9005  //	IntegrationRequest request The request that contains all the new integration information.
  9006  func (c *FusionAuthClient) UpdateIntegrationsWithContext(ctx context.Context, request IntegrationRequest) (*IntegrationResponse, *Errors, error) {
  9007  	var resp IntegrationResponse
  9008  	var errors Errors
  9009  
  9010  	restClient := c.Start(&resp, &errors)
  9011  	err := restClient.WithUri("/api/integration").
  9012  		WithJSONBody(request).
  9013  		WithMethod(http.MethodPut).
  9014  		Do(ctx)
  9015  	if restClient.ErrorRef == nil {
  9016  		return &resp, nil, err
  9017  	}
  9018  	return &resp, &errors, err
  9019  }
  9020  
  9021  // UpdateKey
  9022  // Updates the key with the given Id.
  9023  //
  9024  //	string keyId The Id of the key to update.
  9025  //	KeyRequest request The request that contains all the new key information.
  9026  func (c *FusionAuthClient) UpdateKey(keyId string, request KeyRequest) (*KeyResponse, *Errors, error) {
  9027  	return c.UpdateKeyWithContext(context.TODO(), keyId, request)
  9028  }
  9029  
  9030  // UpdateKeyWithContext
  9031  // Updates the key with the given Id.
  9032  //
  9033  //	string keyId The Id of the key to update.
  9034  //	KeyRequest request The request that contains all the new key information.
  9035  func (c *FusionAuthClient) UpdateKeyWithContext(ctx context.Context, keyId string, request KeyRequest) (*KeyResponse, *Errors, error) {
  9036  	var resp KeyResponse
  9037  	var errors Errors
  9038  
  9039  	restClient := c.Start(&resp, &errors)
  9040  	err := restClient.WithUri("/api/key").
  9041  		WithUriSegment(keyId).
  9042  		WithJSONBody(request).
  9043  		WithMethod(http.MethodPut).
  9044  		Do(ctx)
  9045  	if restClient.ErrorRef == nil {
  9046  		return &resp, nil, err
  9047  	}
  9048  	return &resp, &errors, err
  9049  }
  9050  
  9051  // UpdateLambda
  9052  // Updates the lambda with the given Id.
  9053  //
  9054  //	string lambdaId The Id of the lambda to update.
  9055  //	LambdaRequest request The request that contains all the new lambda information.
  9056  func (c *FusionAuthClient) UpdateLambda(lambdaId string, request LambdaRequest) (*LambdaResponse, *Errors, error) {
  9057  	return c.UpdateLambdaWithContext(context.TODO(), lambdaId, request)
  9058  }
  9059  
  9060  // UpdateLambdaWithContext
  9061  // Updates the lambda with the given Id.
  9062  //
  9063  //	string lambdaId The Id of the lambda to update.
  9064  //	LambdaRequest request The request that contains all the new lambda information.
  9065  func (c *FusionAuthClient) UpdateLambdaWithContext(ctx context.Context, lambdaId string, request LambdaRequest) (*LambdaResponse, *Errors, error) {
  9066  	var resp LambdaResponse
  9067  	var errors Errors
  9068  
  9069  	restClient := c.Start(&resp, &errors)
  9070  	err := restClient.WithUri("/api/lambda").
  9071  		WithUriSegment(lambdaId).
  9072  		WithJSONBody(request).
  9073  		WithMethod(http.MethodPut).
  9074  		Do(ctx)
  9075  	if restClient.ErrorRef == nil {
  9076  		return &resp, nil, err
  9077  	}
  9078  	return &resp, &errors, err
  9079  }
  9080  
  9081  // UpdateMessageTemplate
  9082  // Updates the message template with the given Id.
  9083  //
  9084  //	string messageTemplateId The Id of the message template to update.
  9085  //	MessageTemplateRequest request The request that contains all the new message template information.
  9086  func (c *FusionAuthClient) UpdateMessageTemplate(messageTemplateId string, request MessageTemplateRequest) (*MessageTemplateResponse, *Errors, error) {
  9087  	return c.UpdateMessageTemplateWithContext(context.TODO(), messageTemplateId, request)
  9088  }
  9089  
  9090  // UpdateMessageTemplateWithContext
  9091  // Updates the message template with the given Id.
  9092  //
  9093  //	string messageTemplateId The Id of the message template to update.
  9094  //	MessageTemplateRequest request The request that contains all the new message template information.
  9095  func (c *FusionAuthClient) UpdateMessageTemplateWithContext(ctx context.Context, messageTemplateId string, request MessageTemplateRequest) (*MessageTemplateResponse, *Errors, error) {
  9096  	var resp MessageTemplateResponse
  9097  	var errors Errors
  9098  
  9099  	restClient := c.Start(&resp, &errors)
  9100  	err := restClient.WithUri("/api/message/template").
  9101  		WithUriSegment(messageTemplateId).
  9102  		WithJSONBody(request).
  9103  		WithMethod(http.MethodPut).
  9104  		Do(ctx)
  9105  	if restClient.ErrorRef == nil {
  9106  		return &resp, nil, err
  9107  	}
  9108  	return &resp, &errors, err
  9109  }
  9110  
  9111  // UpdateMessenger
  9112  // Updates the messenger with the given Id.
  9113  //
  9114  //	string messengerId The Id of the messenger to update.
  9115  //	MessengerRequest request The request object that contains all the new messenger information.
  9116  func (c *FusionAuthClient) UpdateMessenger(messengerId string, request MessengerRequest) (*MessengerResponse, *Errors, error) {
  9117  	return c.UpdateMessengerWithContext(context.TODO(), messengerId, request)
  9118  }
  9119  
  9120  // UpdateMessengerWithContext
  9121  // Updates the messenger with the given Id.
  9122  //
  9123  //	string messengerId The Id of the messenger to update.
  9124  //	MessengerRequest request The request object that contains all the new messenger information.
  9125  func (c *FusionAuthClient) UpdateMessengerWithContext(ctx context.Context, messengerId string, request MessengerRequest) (*MessengerResponse, *Errors, error) {
  9126  	var resp MessengerResponse
  9127  	var errors Errors
  9128  
  9129  	restClient := c.Start(&resp, &errors)
  9130  	err := restClient.WithUri("/api/messenger").
  9131  		WithUriSegment(messengerId).
  9132  		WithJSONBody(request).
  9133  		WithMethod(http.MethodPut).
  9134  		Do(ctx)
  9135  	if restClient.ErrorRef == nil {
  9136  		return &resp, nil, err
  9137  	}
  9138  	return &resp, &errors, err
  9139  }
  9140  
  9141  // UpdateOAuthScope
  9142  // Updates the OAuth scope with the given Id for the application.
  9143  //
  9144  //	string applicationId The Id of the application that the OAuth scope belongs to.
  9145  //	string scopeId The Id of the OAuth scope to update.
  9146  //	ApplicationOAuthScopeRequest request The request that contains all the new OAuth scope information.
  9147  func (c *FusionAuthClient) UpdateOAuthScope(applicationId string, scopeId string, request ApplicationOAuthScopeRequest) (*ApplicationOAuthScopeResponse, *Errors, error) {
  9148  	return c.UpdateOAuthScopeWithContext(context.TODO(), applicationId, scopeId, request)
  9149  }
  9150  
  9151  // UpdateOAuthScopeWithContext
  9152  // Updates the OAuth scope with the given Id for the application.
  9153  //
  9154  //	string applicationId The Id of the application that the OAuth scope belongs to.
  9155  //	string scopeId The Id of the OAuth scope to update.
  9156  //	ApplicationOAuthScopeRequest request The request that contains all the new OAuth scope information.
  9157  func (c *FusionAuthClient) UpdateOAuthScopeWithContext(ctx context.Context, applicationId string, scopeId string, request ApplicationOAuthScopeRequest) (*ApplicationOAuthScopeResponse, *Errors, error) {
  9158  	var resp ApplicationOAuthScopeResponse
  9159  	var errors Errors
  9160  
  9161  	restClient := c.Start(&resp, &errors)
  9162  	err := restClient.WithUri("/api/application").
  9163  		WithUriSegment(applicationId).
  9164  		WithUriSegment("scope").
  9165  		WithUriSegment(scopeId).
  9166  		WithJSONBody(request).
  9167  		WithMethod(http.MethodPut).
  9168  		Do(ctx)
  9169  	if restClient.ErrorRef == nil {
  9170  		return &resp, nil, err
  9171  	}
  9172  	return &resp, &errors, err
  9173  }
  9174  
  9175  // UpdateRegistration
  9176  // Updates the registration for the user with the given Id and the application defined in the request.
  9177  //
  9178  //	string userId The Id of the user whose registration is going to be updated.
  9179  //	RegistrationRequest request The request that contains all the new registration information.
  9180  func (c *FusionAuthClient) UpdateRegistration(userId string, request RegistrationRequest) (*RegistrationResponse, *Errors, error) {
  9181  	return c.UpdateRegistrationWithContext(context.TODO(), userId, request)
  9182  }
  9183  
  9184  // UpdateRegistrationWithContext
  9185  // Updates the registration for the user with the given Id and the application defined in the request.
  9186  //
  9187  //	string userId The Id of the user whose registration is going to be updated.
  9188  //	RegistrationRequest request The request that contains all the new registration information.
  9189  func (c *FusionAuthClient) UpdateRegistrationWithContext(ctx context.Context, userId string, request RegistrationRequest) (*RegistrationResponse, *Errors, error) {
  9190  	var resp RegistrationResponse
  9191  	var errors Errors
  9192  
  9193  	restClient := c.Start(&resp, &errors)
  9194  	err := restClient.WithUri("/api/user/registration").
  9195  		WithUriSegment(userId).
  9196  		WithJSONBody(request).
  9197  		WithMethod(http.MethodPut).
  9198  		Do(ctx)
  9199  	if restClient.ErrorRef == nil {
  9200  		return &resp, nil, err
  9201  	}
  9202  	return &resp, &errors, err
  9203  }
  9204  
  9205  // UpdateSystemConfiguration
  9206  // Updates the system configuration.
  9207  //
  9208  //	SystemConfigurationRequest request The request that contains all the new system configuration information.
  9209  func (c *FusionAuthClient) UpdateSystemConfiguration(request SystemConfigurationRequest) (*SystemConfigurationResponse, *Errors, error) {
  9210  	return c.UpdateSystemConfigurationWithContext(context.TODO(), request)
  9211  }
  9212  
  9213  // UpdateSystemConfigurationWithContext
  9214  // Updates the system configuration.
  9215  //
  9216  //	SystemConfigurationRequest request The request that contains all the new system configuration information.
  9217  func (c *FusionAuthClient) UpdateSystemConfigurationWithContext(ctx context.Context, request SystemConfigurationRequest) (*SystemConfigurationResponse, *Errors, error) {
  9218  	var resp SystemConfigurationResponse
  9219  	var errors Errors
  9220  
  9221  	restClient := c.Start(&resp, &errors)
  9222  	err := restClient.WithUri("/api/system-configuration").
  9223  		WithJSONBody(request).
  9224  		WithMethod(http.MethodPut).
  9225  		Do(ctx)
  9226  	if restClient.ErrorRef == nil {
  9227  		return &resp, nil, err
  9228  	}
  9229  	return &resp, &errors, err
  9230  }
  9231  
  9232  // UpdateTenant
  9233  // Updates the tenant with the given Id.
  9234  //
  9235  //	string tenantId The Id of the tenant to update.
  9236  //	TenantRequest request The request that contains all the new tenant information.
  9237  func (c *FusionAuthClient) UpdateTenant(tenantId string, request TenantRequest) (*TenantResponse, *Errors, error) {
  9238  	return c.UpdateTenantWithContext(context.TODO(), tenantId, request)
  9239  }
  9240  
  9241  // UpdateTenantWithContext
  9242  // Updates the tenant with the given Id.
  9243  //
  9244  //	string tenantId The Id of the tenant to update.
  9245  //	TenantRequest request The request that contains all the new tenant information.
  9246  func (c *FusionAuthClient) UpdateTenantWithContext(ctx context.Context, tenantId string, request TenantRequest) (*TenantResponse, *Errors, error) {
  9247  	var resp TenantResponse
  9248  	var errors Errors
  9249  
  9250  	restClient := c.Start(&resp, &errors)
  9251  	err := restClient.WithUri("/api/tenant").
  9252  		WithUriSegment(tenantId).
  9253  		WithJSONBody(request).
  9254  		WithMethod(http.MethodPut).
  9255  		Do(ctx)
  9256  	if restClient.ErrorRef == nil {
  9257  		return &resp, nil, err
  9258  	}
  9259  	return &resp, &errors, err
  9260  }
  9261  
  9262  // UpdateTheme
  9263  // Updates the theme with the given Id.
  9264  //
  9265  //	string themeId The Id of the theme to update.
  9266  //	ThemeRequest request The request that contains all the new theme information.
  9267  func (c *FusionAuthClient) UpdateTheme(themeId string, request ThemeRequest) (*ThemeResponse, *Errors, error) {
  9268  	return c.UpdateThemeWithContext(context.TODO(), themeId, request)
  9269  }
  9270  
  9271  // UpdateThemeWithContext
  9272  // Updates the theme with the given Id.
  9273  //
  9274  //	string themeId The Id of the theme to update.
  9275  //	ThemeRequest request The request that contains all the new theme information.
  9276  func (c *FusionAuthClient) UpdateThemeWithContext(ctx context.Context, themeId string, request ThemeRequest) (*ThemeResponse, *Errors, error) {
  9277  	var resp ThemeResponse
  9278  	var errors Errors
  9279  
  9280  	restClient := c.Start(&resp, &errors)
  9281  	err := restClient.WithUri("/api/theme").
  9282  		WithUriSegment(themeId).
  9283  		WithJSONBody(request).
  9284  		WithMethod(http.MethodPut).
  9285  		Do(ctx)
  9286  	if restClient.ErrorRef == nil {
  9287  		return &resp, nil, err
  9288  	}
  9289  	return &resp, &errors, err
  9290  }
  9291  
  9292  // UpdateUser
  9293  // Updates the user with the given Id.
  9294  //
  9295  //	string userId The Id of the user to update.
  9296  //	UserRequest request The request that contains all the new user information.
  9297  func (c *FusionAuthClient) UpdateUser(userId string, request UserRequest) (*UserResponse, *Errors, error) {
  9298  	return c.UpdateUserWithContext(context.TODO(), userId, request)
  9299  }
  9300  
  9301  // UpdateUserWithContext
  9302  // Updates the user with the given Id.
  9303  //
  9304  //	string userId The Id of the user to update.
  9305  //	UserRequest request The request that contains all the new user information.
  9306  func (c *FusionAuthClient) UpdateUserWithContext(ctx context.Context, userId string, request UserRequest) (*UserResponse, *Errors, error) {
  9307  	var resp UserResponse
  9308  	var errors Errors
  9309  
  9310  	restClient := c.Start(&resp, &errors)
  9311  	err := restClient.WithUri("/api/user").
  9312  		WithUriSegment(userId).
  9313  		WithJSONBody(request).
  9314  		WithMethod(http.MethodPut).
  9315  		Do(ctx)
  9316  	if restClient.ErrorRef == nil {
  9317  		return &resp, nil, err
  9318  	}
  9319  	return &resp, &errors, err
  9320  }
  9321  
  9322  // UpdateUserAction
  9323  // Updates the user action with the given Id.
  9324  //
  9325  //	string userActionId The Id of the user action to update.
  9326  //	UserActionRequest request The request that contains all the new user action information.
  9327  func (c *FusionAuthClient) UpdateUserAction(userActionId string, request UserActionRequest) (*UserActionResponse, *Errors, error) {
  9328  	return c.UpdateUserActionWithContext(context.TODO(), userActionId, request)
  9329  }
  9330  
  9331  // UpdateUserActionWithContext
  9332  // Updates the user action with the given Id.
  9333  //
  9334  //	string userActionId The Id of the user action to update.
  9335  //	UserActionRequest request The request that contains all the new user action information.
  9336  func (c *FusionAuthClient) UpdateUserActionWithContext(ctx context.Context, userActionId string, request UserActionRequest) (*UserActionResponse, *Errors, error) {
  9337  	var resp UserActionResponse
  9338  	var errors Errors
  9339  
  9340  	restClient := c.Start(&resp, &errors)
  9341  	err := restClient.WithUri("/api/user-action").
  9342  		WithUriSegment(userActionId).
  9343  		WithJSONBody(request).
  9344  		WithMethod(http.MethodPut).
  9345  		Do(ctx)
  9346  	if restClient.ErrorRef == nil {
  9347  		return &resp, nil, err
  9348  	}
  9349  	return &resp, &errors, err
  9350  }
  9351  
  9352  // UpdateUserActionReason
  9353  // Updates the user action reason with the given Id.
  9354  //
  9355  //	string userActionReasonId The Id of the user action reason to update.
  9356  //	UserActionReasonRequest request The request that contains all the new user action reason information.
  9357  func (c *FusionAuthClient) UpdateUserActionReason(userActionReasonId string, request UserActionReasonRequest) (*UserActionReasonResponse, *Errors, error) {
  9358  	return c.UpdateUserActionReasonWithContext(context.TODO(), userActionReasonId, request)
  9359  }
  9360  
  9361  // UpdateUserActionReasonWithContext
  9362  // Updates the user action reason with the given Id.
  9363  //
  9364  //	string userActionReasonId The Id of the user action reason to update.
  9365  //	UserActionReasonRequest request The request that contains all the new user action reason information.
  9366  func (c *FusionAuthClient) UpdateUserActionReasonWithContext(ctx context.Context, userActionReasonId string, request UserActionReasonRequest) (*UserActionReasonResponse, *Errors, error) {
  9367  	var resp UserActionReasonResponse
  9368  	var errors Errors
  9369  
  9370  	restClient := c.Start(&resp, &errors)
  9371  	err := restClient.WithUri("/api/user-action-reason").
  9372  		WithUriSegment(userActionReasonId).
  9373  		WithJSONBody(request).
  9374  		WithMethod(http.MethodPut).
  9375  		Do(ctx)
  9376  	if restClient.ErrorRef == nil {
  9377  		return &resp, nil, err
  9378  	}
  9379  	return &resp, &errors, err
  9380  }
  9381  
  9382  // UpdateUserConsent
  9383  // Updates a single User consent by Id.
  9384  //
  9385  //	string userConsentId The User Consent Id
  9386  //	UserConsentRequest request The request that contains the user consent information.
  9387  func (c *FusionAuthClient) UpdateUserConsent(userConsentId string, request UserConsentRequest) (*UserConsentResponse, *Errors, error) {
  9388  	return c.UpdateUserConsentWithContext(context.TODO(), userConsentId, request)
  9389  }
  9390  
  9391  // UpdateUserConsentWithContext
  9392  // Updates a single User consent by Id.
  9393  //
  9394  //	string userConsentId The User Consent Id
  9395  //	UserConsentRequest request The request that contains the user consent information.
  9396  func (c *FusionAuthClient) UpdateUserConsentWithContext(ctx context.Context, userConsentId string, request UserConsentRequest) (*UserConsentResponse, *Errors, error) {
  9397  	var resp UserConsentResponse
  9398  	var errors Errors
  9399  
  9400  	restClient := c.Start(&resp, &errors)
  9401  	err := restClient.WithUri("/api/user/consent").
  9402  		WithUriSegment(userConsentId).
  9403  		WithJSONBody(request).
  9404  		WithMethod(http.MethodPut).
  9405  		Do(ctx)
  9406  	if restClient.ErrorRef == nil {
  9407  		return &resp, nil, err
  9408  	}
  9409  	return &resp, &errors, err
  9410  }
  9411  
  9412  // UpdateWebhook
  9413  // Updates the webhook with the given Id.
  9414  //
  9415  //	string webhookId The Id of the webhook to update.
  9416  //	WebhookRequest request The request that contains all the new webhook information.
  9417  func (c *FusionAuthClient) UpdateWebhook(webhookId string, request WebhookRequest) (*WebhookResponse, *Errors, error) {
  9418  	return c.UpdateWebhookWithContext(context.TODO(), webhookId, request)
  9419  }
  9420  
  9421  // UpdateWebhookWithContext
  9422  // Updates the webhook with the given Id.
  9423  //
  9424  //	string webhookId The Id of the webhook to update.
  9425  //	WebhookRequest request The request that contains all the new webhook information.
  9426  func (c *FusionAuthClient) UpdateWebhookWithContext(ctx context.Context, webhookId string, request WebhookRequest) (*WebhookResponse, *Errors, error) {
  9427  	var resp WebhookResponse
  9428  	var errors Errors
  9429  
  9430  	restClient := c.Start(&resp, &errors)
  9431  	err := restClient.WithUri("/api/webhook").
  9432  		WithUriSegment(webhookId).
  9433  		WithJSONBody(request).
  9434  		WithMethod(http.MethodPut).
  9435  		Do(ctx)
  9436  	if restClient.ErrorRef == nil {
  9437  		return &resp, nil, err
  9438  	}
  9439  	return &resp, &errors, err
  9440  }
  9441  
  9442  // UpsertEntityGrant
  9443  // Creates or updates an Entity Grant. This is when a User/Entity is granted permissions to an Entity.
  9444  //
  9445  //	string entityId The Id of the Entity that the User/Entity is being granted access to.
  9446  //	EntityGrantRequest request The request object that contains all the information used to create the Entity Grant.
  9447  func (c *FusionAuthClient) UpsertEntityGrant(entityId string, request EntityGrantRequest) (*BaseHTTPResponse, *Errors, error) {
  9448  	return c.UpsertEntityGrantWithContext(context.TODO(), entityId, request)
  9449  }
  9450  
  9451  // UpsertEntityGrantWithContext
  9452  // Creates or updates an Entity Grant. This is when a User/Entity is granted permissions to an Entity.
  9453  //
  9454  //	string entityId The Id of the Entity that the User/Entity is being granted access to.
  9455  //	EntityGrantRequest request The request object that contains all the information used to create the Entity Grant.
  9456  func (c *FusionAuthClient) UpsertEntityGrantWithContext(ctx context.Context, entityId string, request EntityGrantRequest) (*BaseHTTPResponse, *Errors, error) {
  9457  	var resp BaseHTTPResponse
  9458  	var errors Errors
  9459  
  9460  	restClient := c.Start(&resp, &errors)
  9461  	err := restClient.WithUri("/api/entity").
  9462  		WithUriSegment(entityId).
  9463  		WithUriSegment("grant").
  9464  		WithJSONBody(request).
  9465  		WithMethod(http.MethodPost).
  9466  		Do(ctx)
  9467  	if restClient.ErrorRef == nil {
  9468  		return &resp, nil, err
  9469  	}
  9470  	return &resp, &errors, err
  9471  }
  9472  
  9473  // ValidateDevice
  9474  // Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant.
  9475  // If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant.
  9476  //
  9477  //	string userCode The end-user verification code.
  9478  //	string clientId The client id.
  9479  func (c *FusionAuthClient) ValidateDevice(userCode string, clientId string) (*BaseHTTPResponse, error) {
  9480  	return c.ValidateDeviceWithContext(context.TODO(), userCode, clientId)
  9481  }
  9482  
  9483  // ValidateDeviceWithContext
  9484  // Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant.
  9485  // If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant.
  9486  //
  9487  //	string userCode The end-user verification code.
  9488  //	string clientId The client id.
  9489  func (c *FusionAuthClient) ValidateDeviceWithContext(ctx context.Context, userCode string, clientId string) (*BaseHTTPResponse, error) {
  9490  	var resp BaseHTTPResponse
  9491  
  9492  	err := c.StartAnonymous(&resp, nil).
  9493  		WithUri("/oauth2/device/validate").
  9494  		WithParameter("user_code", userCode).
  9495  		WithParameter("client_id", clientId).
  9496  		WithMethod(http.MethodGet).
  9497  		Do(ctx)
  9498  	return &resp, err
  9499  }
  9500  
  9501  // ValidateJWT
  9502  // Validates the provided JWT (encoded JWT string) to ensure the token is valid. A valid access token is properly
  9503  // signed and not expired.
  9504  // <p>
  9505  // This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims.
  9506  //
  9507  //	string encodedJWT The encoded JWT (access token).
  9508  func (c *FusionAuthClient) ValidateJWT(encodedJWT string) (*ValidateResponse, error) {
  9509  	return c.ValidateJWTWithContext(context.TODO(), encodedJWT)
  9510  }
  9511  
  9512  // ValidateJWTWithContext
  9513  // Validates the provided JWT (encoded JWT string) to ensure the token is valid. A valid access token is properly
  9514  // signed and not expired.
  9515  // <p>
  9516  // This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims.
  9517  //
  9518  //	string encodedJWT The encoded JWT (access token).
  9519  func (c *FusionAuthClient) ValidateJWTWithContext(ctx context.Context, encodedJWT string) (*ValidateResponse, error) {
  9520  	var resp ValidateResponse
  9521  
  9522  	err := c.StartAnonymous(&resp, nil).
  9523  		WithUri("/api/jwt/validate").
  9524  		WithAuthorization("Bearer " + encodedJWT).
  9525  		WithMethod(http.MethodGet).
  9526  		Do(ctx)
  9527  	return &resp, err
  9528  }
  9529  
  9530  // VendJWT
  9531  // It's a JWT vending machine!
  9532  //
  9533  // Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form
  9534  // token that will contain what claims you provide.
  9535  // <p>
  9536  // The iat, exp and jti claims will be added by FusionAuth, all other claims must be provided by the caller.
  9537  //
  9538  // If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either
  9539  // by way of the X-FusionAuth-TenantId request header, or a tenant scoped API key.
  9540  //
  9541  //	JWTVendRequest request The request that contains all the claims for this JWT.
  9542  func (c *FusionAuthClient) VendJWT(request JWTVendRequest) (*JWTVendResponse, *Errors, error) {
  9543  	return c.VendJWTWithContext(context.TODO(), request)
  9544  }
  9545  
  9546  // VendJWTWithContext
  9547  // It's a JWT vending machine!
  9548  //
  9549  // Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form
  9550  // token that will contain what claims you provide.
  9551  // <p>
  9552  // The iat, exp and jti claims will be added by FusionAuth, all other claims must be provided by the caller.
  9553  //
  9554  // If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either
  9555  // by way of the X-FusionAuth-TenantId request header, or a tenant scoped API key.
  9556  //
  9557  //	JWTVendRequest request The request that contains all the claims for this JWT.
  9558  func (c *FusionAuthClient) VendJWTWithContext(ctx context.Context, request JWTVendRequest) (*JWTVendResponse, *Errors, error) {
  9559  	var resp JWTVendResponse
  9560  	var errors Errors
  9561  
  9562  	restClient := c.Start(&resp, &errors)
  9563  	err := restClient.WithUri("/api/jwt/vend").
  9564  		WithJSONBody(request).
  9565  		WithMethod(http.MethodPost).
  9566  		Do(ctx)
  9567  	if restClient.ErrorRef == nil {
  9568  		return &resp, nil, err
  9569  	}
  9570  	return &resp, &errors, err
  9571  }
  9572  
  9573  // VerifyEmail
  9574  // Confirms a email verification. The Id given is usually from an email sent to the user.
  9575  //
  9576  //	string verificationId The email verification Id sent to the user.
  9577  //
  9578  // Deprecated: This method has been renamed to VerifyEmailAddress and changed to take a JSON request body, use that method instead.
  9579  func (c *FusionAuthClient) VerifyEmail(verificationId string) (*BaseHTTPResponse, *Errors, error) {
  9580  	return c.VerifyEmailWithContext(context.TODO(), verificationId)
  9581  }
  9582  
  9583  // VerifyEmailWithContext
  9584  // Confirms a email verification. The Id given is usually from an email sent to the user.
  9585  //
  9586  //	string verificationId The email verification Id sent to the user.
  9587  //
  9588  // Deprecated: This method has been renamed to VerifyEmailAddressWithContext and changed to take a JSON request body, use that method instead.
  9589  func (c *FusionAuthClient) VerifyEmailWithContext(ctx context.Context, verificationId string) (*BaseHTTPResponse, *Errors, error) {
  9590  	var resp BaseHTTPResponse
  9591  	var errors Errors
  9592  
  9593  	restClient := c.StartAnonymous(&resp, &errors)
  9594  	err := restClient.WithUri("/api/user/verify-email").
  9595  		WithUriSegment(verificationId).
  9596  		WithMethod(http.MethodPost).
  9597  		Do(ctx)
  9598  	if restClient.ErrorRef == nil {
  9599  		return &resp, nil, err
  9600  	}
  9601  	return &resp, &errors, err
  9602  }
  9603  
  9604  // VerifyEmailAddress
  9605  // Confirms a user's email address.
  9606  //
  9607  // The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
  9608  // the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one.
  9609  // The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
  9610  // two values together are able to confirm a user's email address and mark the user's email address as verified.
  9611  //
  9612  //	VerifyEmailRequest request The request that contains the verificationId and optional one-time use code paired with the verificationId.
  9613  func (c *FusionAuthClient) VerifyEmailAddress(request VerifyEmailRequest) (*BaseHTTPResponse, *Errors, error) {
  9614  	return c.VerifyEmailAddressWithContext(context.TODO(), request)
  9615  }
  9616  
  9617  // VerifyEmailAddressWithContext
  9618  // Confirms a user's email address.
  9619  //
  9620  // The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
  9621  // the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one.
  9622  // The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
  9623  // two values together are able to confirm a user's email address and mark the user's email address as verified.
  9624  //
  9625  //	VerifyEmailRequest request The request that contains the verificationId and optional one-time use code paired with the verificationId.
  9626  func (c *FusionAuthClient) VerifyEmailAddressWithContext(ctx context.Context, request VerifyEmailRequest) (*BaseHTTPResponse, *Errors, error) {
  9627  	var resp BaseHTTPResponse
  9628  	var errors Errors
  9629  
  9630  	restClient := c.StartAnonymous(&resp, &errors)
  9631  	err := restClient.WithUri("/api/user/verify-email").
  9632  		WithJSONBody(request).
  9633  		WithMethod(http.MethodPost).
  9634  		Do(ctx)
  9635  	if restClient.ErrorRef == nil {
  9636  		return &resp, nil, err
  9637  	}
  9638  	return &resp, &errors, err
  9639  }
  9640  
  9641  // VerifyEmailAddressByUserId
  9642  // Administratively verify a user's email address. Use this method to bypass email verification for the user.
  9643  //
  9644  // The request body will contain the userId to be verified. An API key is required when sending the userId in the request body.
  9645  //
  9646  //	VerifyEmailRequest request The request that contains the userId to verify.
  9647  func (c *FusionAuthClient) VerifyEmailAddressByUserId(request VerifyEmailRequest) (*BaseHTTPResponse, *Errors, error) {
  9648  	return c.VerifyEmailAddressByUserIdWithContext(context.TODO(), request)
  9649  }
  9650  
  9651  // VerifyEmailAddressByUserIdWithContext
  9652  // Administratively verify a user's email address. Use this method to bypass email verification for the user.
  9653  //
  9654  // The request body will contain the userId to be verified. An API key is required when sending the userId in the request body.
  9655  //
  9656  //	VerifyEmailRequest request The request that contains the userId to verify.
  9657  func (c *FusionAuthClient) VerifyEmailAddressByUserIdWithContext(ctx context.Context, request VerifyEmailRequest) (*BaseHTTPResponse, *Errors, error) {
  9658  	var resp BaseHTTPResponse
  9659  	var errors Errors
  9660  
  9661  	restClient := c.Start(&resp, &errors)
  9662  	err := restClient.WithUri("/api/user/verify-email").
  9663  		WithJSONBody(request).
  9664  		WithMethod(http.MethodPost).
  9665  		Do(ctx)
  9666  	if restClient.ErrorRef == nil {
  9667  		return &resp, nil, err
  9668  	}
  9669  	return &resp, &errors, err
  9670  }
  9671  
  9672  // VerifyRegistration
  9673  // Confirms an application registration. The Id given is usually from an email sent to the user.
  9674  //
  9675  //	string verificationId The registration verification Id sent to the user.
  9676  //
  9677  // Deprecated: This method has been renamed to VerifyUserRegistration and changed to take a JSON request body, use that method instead.
  9678  func (c *FusionAuthClient) VerifyRegistration(verificationId string) (*BaseHTTPResponse, *Errors, error) {
  9679  	return c.VerifyRegistrationWithContext(context.TODO(), verificationId)
  9680  }
  9681  
  9682  // VerifyRegistrationWithContext
  9683  // Confirms an application registration. The Id given is usually from an email sent to the user.
  9684  //
  9685  //	string verificationId The registration verification Id sent to the user.
  9686  //
  9687  // Deprecated: This method has been renamed to VerifyUserRegistrationWithContext and changed to take a JSON request body, use that method instead.
  9688  func (c *FusionAuthClient) VerifyRegistrationWithContext(ctx context.Context, verificationId string) (*BaseHTTPResponse, *Errors, error) {
  9689  	var resp BaseHTTPResponse
  9690  	var errors Errors
  9691  
  9692  	restClient := c.StartAnonymous(&resp, &errors)
  9693  	err := restClient.WithUri("/api/user/verify-registration").
  9694  		WithUriSegment(verificationId).
  9695  		WithMethod(http.MethodPost).
  9696  		Do(ctx)
  9697  	if restClient.ErrorRef == nil {
  9698  		return &resp, nil, err
  9699  	}
  9700  	return &resp, &errors, err
  9701  }
  9702  
  9703  // VerifyUserRegistration
  9704  // Confirms a user's registration.
  9705  //
  9706  // The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
  9707  // the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one.
  9708  // The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
  9709  // two values together are able to confirm a user's registration and mark the user's registration as verified.
  9710  //
  9711  //	VerifyRegistrationRequest request The request that contains the verificationId and optional one-time use code paired with the verificationId.
  9712  func (c *FusionAuthClient) VerifyUserRegistration(request VerifyRegistrationRequest) (*BaseHTTPResponse, *Errors, error) {
  9713  	return c.VerifyUserRegistrationWithContext(context.TODO(), request)
  9714  }
  9715  
  9716  // VerifyUserRegistrationWithContext
  9717  // Confirms a user's registration.
  9718  //
  9719  // The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
  9720  // the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one.
  9721  // The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
  9722  // two values together are able to confirm a user's registration and mark the user's registration as verified.
  9723  //
  9724  //	VerifyRegistrationRequest request The request that contains the verificationId and optional one-time use code paired with the verificationId.
  9725  func (c *FusionAuthClient) VerifyUserRegistrationWithContext(ctx context.Context, request VerifyRegistrationRequest) (*BaseHTTPResponse, *Errors, error) {
  9726  	var resp BaseHTTPResponse
  9727  	var errors Errors
  9728  
  9729  	restClient := c.StartAnonymous(&resp, &errors)
  9730  	err := restClient.WithUri("/api/user/verify-registration").
  9731  		WithJSONBody(request).
  9732  		WithMethod(http.MethodPost).
  9733  		Do(ctx)
  9734  	if restClient.ErrorRef == nil {
  9735  		return &resp, nil, err
  9736  	}
  9737  	return &resp, &errors, err
  9738  }