From c9101f93336eb0f1657c1e035d1c96957e147fbf Mon Sep 17 00:00:00 2001 From: Matthew Altman Date: Wed, 11 Dec 2019 09:25:26 -0700 Subject: [PATCH] modify clients to use api key where appropriate --- pkg/fusionauth/Client.go | 4415 +++++++++++++++++++------------------- pkg/fusionauth/Domain.go | 2649 ++++++++++++----------- 2 files changed, 3573 insertions(+), 3491 deletions(-) diff --git a/pkg/fusionauth/Client.go b/pkg/fusionauth/Client.go index e20adcf..3bedf92 100644 --- a/pkg/fusionauth/Client.go +++ b/pkg/fusionauth/Client.go @@ -12,168 +12,168 @@ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. -*/ + */ package fusionauth import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net/http" - "net/http/httputil" - "net/url" - "path" - "strconv" - "strings" + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httputil" + "net/url" + "path" + "strconv" + "strings" ) // NewClient creates a new FusionAuthClient // if httpClient is nil then a DefaultClient is used func NewClient(httpClient *http.Client, baseURL *url.URL, apiKey string) *FusionAuthClient { - if httpClient == nil { - httpClient = http.DefaultClient - } - c := &FusionAuthClient{ - HTTPClient: httpClient, - BaseURL: baseURL, - APIKey: apiKey} + if httpClient == nil { + httpClient = http.DefaultClient + } + c := &FusionAuthClient{ + HTTPClient: httpClient, + BaseURL: baseURL, + APIKey: apiKey} - return c + return c } // SetTenantId sets the tenantId on the client -func (c *FusionAuthClient) SetTenantId(tenantId string) { - c.TenantId = tenantId +func (c *FusionAuthClient) SetTenantId(tenantId string) { + c.TenantId = tenantId } // FusionAuthClient describes the Go Client for interacting with FusionAuth's RESTful API type FusionAuthClient struct { - HTTPClient *http.Client - BaseURL *url.URL - APIKey string - Debug bool - TenantId string + HTTPClient *http.Client + BaseURL *url.URL + APIKey string + Debug bool + TenantId string } type restClient struct { - Body io.Reader - Debug bool - ErrorRef interface{} - Headers map[string]string - HTTPClient *http.Client - Method string - ResponseRef interface{} - Uri *url.URL + Body io.Reader + Debug bool + ErrorRef interface{} + Headers map[string]string + HTTPClient *http.Client + Method string + ResponseRef interface{} + Uri *url.URL } func (c *FusionAuthClient) Start(responseRef interface{}, errorRef interface{}) *restClient { - return c.StartAnonymous(responseRef, errorRef).WithAuthorization(c.APIKey) + return c.StartAnonymous(responseRef, errorRef).WithAuthorization(c.APIKey) } func (c *FusionAuthClient) StartAnonymous(responseRef interface{}, errorRef interface{}) *restClient { - rc := &restClient{ - Debug: c.Debug, - ErrorRef: errorRef, - Headers: make(map[string]string), - HTTPClient: c.HTTPClient, - ResponseRef: responseRef, - } - rc.Uri, _ = url.Parse(c.BaseURL.String()) - if c.TenantId != "" { - rc.WithHeader("X-FusionAuth-TenantId", c.TenantId) - } - rc.WithHeader("Content-Type", "text/plain") - rc.WithHeader("Accept", "application/json") - return rc + rc := &restClient{ + Debug: c.Debug, + ErrorRef: errorRef, + Headers: make(map[string]string), + HTTPClient: c.HTTPClient, + ResponseRef: responseRef, + } + rc.Uri, _ = url.Parse(c.BaseURL.String()) + if c.TenantId != "" { + rc.WithHeader("X-FusionAuth-TenantId", c.TenantId) + } + rc.WithHeader("Content-Type", "text/plain") + rc.WithHeader("Accept", "application/json") + return rc } func (rc *restClient) Do() error { - req, err := http.NewRequest(rc.Method, rc.Uri.String(), rc.Body) - if err != nil { - return err - } - for key, val := range rc.Headers { - req.Header.Set(key, val) - } - resp, err := rc.HTTPClient.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - if rc.Debug { - responseDump, _ := httputil.DumpResponse(resp, true) - fmt.Println(string(responseDump)) - } - if resp.StatusCode < 200 || resp.StatusCode > 299 { - if rc.ErrorRef != nil { - err = json.NewDecoder(resp.Body).Decode(rc.ErrorRef) - } - } else { - rc.ErrorRef = nil - if _, ok := rc.ResponseRef.(*BaseHTTPResponse); !ok { - err = json.NewDecoder(resp.Body).Decode(rc.ResponseRef) - } - } - rc.ResponseRef.(StatusAble).SetStatus(resp.StatusCode) - return err + req, err := http.NewRequest(rc.Method, rc.Uri.String(), rc.Body) + if err != nil { + return err + } + for key, val := range rc.Headers { + req.Header.Set(key, val) + } + resp, err := rc.HTTPClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if rc.Debug { + responseDump, _ := httputil.DumpResponse(resp, true) + fmt.Println(string(responseDump)) + } + if resp.StatusCode < 200 || resp.StatusCode > 299 { + if rc.ErrorRef != nil { + err = json.NewDecoder(resp.Body).Decode(rc.ErrorRef) + } + } else { + rc.ErrorRef = nil + if _, ok := rc.ResponseRef.(*BaseHTTPResponse); !ok { + err = json.NewDecoder(resp.Body).Decode(rc.ResponseRef) + } + } + rc.ResponseRef.(StatusAble).SetStatus(resp.StatusCode) + return err } func (rc *restClient) WithAuthorization(key string) *restClient { - if key != "" { - rc.WithHeader("Authorization", key) - } - return rc + if key != "" { + rc.WithHeader("Authorization", key) + } + return rc } func (rc *restClient) WithFormData(formBody url.Values) *restClient { - rc.WithHeader("Content-Type", "application/x-www-form-urlencoded") - rc.Body = strings.NewReader(formBody.Encode()) - return rc + rc.WithHeader("Content-Type", "application/x-www-form-urlencoded") + rc.Body = strings.NewReader(formBody.Encode()) + return rc } func (rc *restClient) WithHeader(key string, value string) *restClient { - rc.Headers[key] = value - return rc + rc.Headers[key] = value + return rc } func (rc *restClient) WithJSONBody(body interface{}) *restClient { - rc.WithHeader("Content-Type", "application/json") - buf := new(bytes.Buffer) - json.NewEncoder(buf).Encode(body) - rc.Body = buf - return rc + rc.WithHeader("Content-Type", "application/json") + buf := new(bytes.Buffer) + json.NewEncoder(buf).Encode(body) + rc.Body = buf + return rc } func (rc *restClient) WithMethod(method string) *restClient { - rc.Method = method - return rc + rc.Method = method + return rc } func (rc *restClient) WithParameter(key string, value interface{}) *restClient { - q := rc.Uri.Query() - if x, ok := value.([]string); ok { - for _, i := range x { - q.Add(key, i) - } - } else { - q.Add(key, fmt.Sprintf("%v", value)) - } - rc.Uri.RawQuery = q.Encode() - return rc + q := rc.Uri.Query() + if x, ok := value.([]string); ok { + for _, i := range x { + q.Add(key, i) + } + } else { + q.Add(key, fmt.Sprintf("%v", value)) + } + rc.Uri.RawQuery = q.Encode() + return rc } func (rc *restClient) WithUri(uri string) *restClient { - rc.Uri.Path = path.Join(rc.Uri.Path, uri) - return rc + rc.Uri.Path = path.Join(rc.Uri.Path, uri) + return rc } func (rc *restClient) WithUriSegment(segment string) *restClient { - if segment != "" { - rc.Uri.Path = path.Join(rc.Uri.Path, "/"+segment) - } - return rc + if segment != "" { + rc.Uri.Path = path.Join(rc.Uri.Path, "/"+segment) + } + return rc } // ActionUser @@ -184,19 +184,19 @@ func (rc *restClient) WithUriSegment(segment string) *restClient { // ActionRequest request The action request that includes all of the information about the action being taken including // the id of the action, any options and the duration (if applicable). func (c *FusionAuthClient) ActionUser(actioneeUserId string, request ActionRequest) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithUriSegment(actioneeUserId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithUriSegment(actioneeUserId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // AddUserToFamily @@ -204,19 +204,19 @@ func (c *FusionAuthClient) ActionUser(actioneeUserId string, request ActionReque // string familyId The id of the family. // FamilyRequest request The request object that contains all of the information used to determine which user to add to the family. func (c *FusionAuthClient) AddUserToFamily(familyId string, request FamilyRequest) (*FamilyResponse, *Errors, error) { - var resp FamilyResponse - var errors Errors + var resp FamilyResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/family"). - WithUriSegment(familyId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/family"). + WithUriSegment(familyId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CancelAction @@ -224,19 +224,19 @@ func (c *FusionAuthClient) AddUserToFamily(familyId string, request FamilyReques // string actionId The action id of the action to cancel. // ActionRequest request The action request that contains the information about the cancellation. func (c *FusionAuthClient) CancelAction(actionId string, request ActionRequest) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithUriSegment(actionId). - WithJSONBody(request). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithUriSegment(actionId). + WithJSONBody(request). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ChangePassword @@ -245,19 +245,19 @@ func (c *FusionAuthClient) CancelAction(actionId string, request ActionRequest) // 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. // ChangePasswordRequest request The change password request that contains all of the information used to change the password. func (c *FusionAuthClient) ChangePassword(changePasswordId string, request ChangePasswordRequest) (*ChangePasswordResponse, *Errors, error) { - var resp ChangePasswordResponse - var errors Errors + var resp ChangePasswordResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user/change-password"). - WithUriSegment(changePasswordId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/change-password"). + WithUriSegment(changePasswordId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ChangePasswordByIdentity @@ -266,36 +266,36 @@ func (c *FusionAuthClient) ChangePassword(changePasswordId string, request Chang // method. // ChangePasswordRequest request The change password request that contains all of the information used to change the password. func (c *FusionAuthClient) ChangePasswordByIdentity(request ChangePasswordRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/change-password"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/change-password"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CommentOnUser // Adds a comment to the user's account. // UserCommentRequest request The request object that contains all of the information used to create the user comment. func (c *FusionAuthClient) CommentOnUser(request UserCommentRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/comment"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/comment"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateApplication @@ -303,19 +303,19 @@ func (c *FusionAuthClient) CommentOnUser(request UserCommentRequest) (*BaseHTTPR // string applicationId (Optional) The Id to use for the application. If not provided a secure random UUID will be generated. // ApplicationRequest request The request object that contains all of the information used to create the application. func (c *FusionAuthClient) CreateApplication(applicationId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors + var resp ApplicationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateApplicationRole @@ -325,21 +325,21 @@ func (c *FusionAuthClient) CreateApplication(applicationId string, request Appli // string roleId (Optional) The Id of the role. If not provided a secure random UUID will be generated. // ApplicationRequest request The request object that contains all of the information used to create the application role. func (c *FusionAuthClient) CreateApplicationRole(applicationId string, roleId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithUriSegment("role"). - WithUriSegment(roleId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp ApplicationResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithUriSegment("role"). + WithUriSegment(roleId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateAuditLog @@ -348,18 +348,18 @@ func (c *FusionAuthClient) CreateApplicationRole(applicationId string, roleId st // written to the audit log. However, if you are accessing the API, you must write the audit logs yourself. // AuditLogRequest request The request object that contains all of the information used to create the audit log entry. func (c *FusionAuthClient) CreateAuditLog(request AuditLogRequest) (*AuditLogResponse, *Errors, error) { - var resp AuditLogResponse - var errors Errors + var resp AuditLogResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/system/audit-log"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/system/audit-log"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateConsent @@ -367,19 +367,19 @@ func (c *FusionAuthClient) CreateAuditLog(request AuditLogRequest) (*AuditLogRes // string consentId (Optional) The Id for the consent. If not provided a secure random UUID will be generated. // ConsentRequest request The request object that contains all of the information used to create the consent. func (c *FusionAuthClient) CreateConsent(consentId string, request ConsentRequest) (*ConsentResponse, *Errors, error) { - var resp ConsentResponse - var errors Errors + var resp ConsentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/consent"). - WithUriSegment(consentId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/consent"). + WithUriSegment(consentId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateEmailTemplate @@ -387,19 +387,19 @@ func (c *FusionAuthClient) CreateConsent(consentId string, request ConsentReques // string emailTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated. // EmailTemplateRequest request The request object that contains all of the information used to create the email template. func (c *FusionAuthClient) CreateEmailTemplate(emailTemplateId string, request EmailTemplateRequest) (*EmailTemplateResponse, *Errors, error) { - var resp EmailTemplateResponse - var errors Errors + var resp EmailTemplateResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/email/template"). - WithUriSegment(emailTemplateId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/email/template"). + WithUriSegment(emailTemplateId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateFamily @@ -408,19 +408,19 @@ func (c *FusionAuthClient) CreateEmailTemplate(emailTemplateId string, request E // string familyId (Optional) The id for the family. If not provided a secure random UUID will be generated. // FamilyRequest request The request object that contains all of the information used to create the family. func (c *FusionAuthClient) CreateFamily(familyId string, request FamilyRequest) (*FamilyResponse, *Errors, error) { - var resp FamilyResponse - var errors Errors + var resp FamilyResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/family"). - WithUriSegment(familyId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/family"). + WithUriSegment(familyId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateGroup @@ -428,37 +428,37 @@ func (c *FusionAuthClient) CreateFamily(familyId string, request FamilyRequest) // string groupId (Optional) The Id for the group. If not provided a secure random UUID will be generated. // GroupRequest request The request object that contains all of the information used to create the group. func (c *FusionAuthClient) CreateGroup(groupId string, request GroupRequest) (*GroupResponse, *Errors, error) { - var resp GroupResponse - var errors Errors + var resp GroupResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group"). - WithUriSegment(groupId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group"). + WithUriSegment(groupId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateGroupMembers // Creates a member in a group. // MemberRequest request The request object that contains all of the information used to create the group member(s). func (c *FusionAuthClient) CreateGroupMembers(request MemberRequest) (*MemberResponse, *Errors, error) { - var resp MemberResponse - var errors Errors + var resp MemberResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group/member"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group/member"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateLambda @@ -466,19 +466,19 @@ func (c *FusionAuthClient) CreateGroupMembers(request MemberRequest) (*MemberRes // string lambdaId (Optional) The Id for the lambda. If not provided a secure random UUID will be generated. // LambdaRequest request The request object that contains all of the information used to create the lambda. func (c *FusionAuthClient) CreateLambda(lambdaId string, request LambdaRequest) (*LambdaResponse, *Errors, error) { - var resp LambdaResponse - var errors Errors + var resp LambdaResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/lambda"). - WithUriSegment(lambdaId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/lambda"). + WithUriSegment(lambdaId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateTenant @@ -486,19 +486,19 @@ func (c *FusionAuthClient) CreateLambda(lambdaId string, request LambdaRequest) // string tenantId (Optional) The Id for the tenant. If not provided a secure random UUID will be generated. // TenantRequest request The request object that contains all of the information used to create the tenant. func (c *FusionAuthClient) CreateTenant(tenantId string, request TenantRequest) (*TenantResponse, *Errors, error) { - var resp TenantResponse - var errors Errors + var resp TenantResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/tenant"). - WithUriSegment(tenantId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant"). + WithUriSegment(tenantId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateTheme @@ -506,19 +506,19 @@ func (c *FusionAuthClient) CreateTenant(tenantId string, request TenantRequest) // string themeId (Optional) The Id for the theme. If not provided a secure random UUID will be generated. // ThemeRequest request The request object that contains all of the information used to create the theme. func (c *FusionAuthClient) CreateTheme(themeId string, request ThemeRequest) (*ThemeResponse, *Errors, error) { - var resp ThemeResponse - var errors Errors + var resp ThemeResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/theme"). - WithUriSegment(themeId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/theme"). + WithUriSegment(themeId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateUser @@ -526,19 +526,19 @@ func (c *FusionAuthClient) CreateTheme(themeId string, request ThemeRequest) (*T // string userId (Optional) The Id for the user. If not provided a secure random UUID will be generated. // UserRequest request The request object that contains all of the information used to create the user. func (c *FusionAuthClient) CreateUser(userId string, request UserRequest) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateUserAction @@ -547,19 +547,19 @@ func (c *FusionAuthClient) CreateUser(userId string, request UserRequest) (*User // string userActionId (Optional) The Id for the user action. If not provided a secure random UUID will be generated. // UserActionRequest request The request object that contains all of the information used to create the user action. func (c *FusionAuthClient) CreateUserAction(userActionId string, request UserActionRequest) (*UserActionResponse, *Errors, error) { - var resp UserActionResponse - var errors Errors + var resp UserActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateUserActionReason @@ -568,19 +568,19 @@ func (c *FusionAuthClient) CreateUserAction(userActionId string, request UserAct // string userActionReasonId (Optional) The Id for the user action reason. If not provided a secure random UUID will be generated. // UserActionReasonRequest request The request object that contains all of the information used to create the user action reason. func (c *FusionAuthClient) CreateUserActionReason(userActionReasonId string, request UserActionReasonRequest) (*UserActionReasonResponse, *Errors, error) { - var resp UserActionReasonResponse - var errors Errors + var resp UserActionReasonResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action-reason"). - WithUriSegment(userActionReasonId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action-reason"). + WithUriSegment(userActionReasonId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateUserConsent @@ -588,19 +588,19 @@ func (c *FusionAuthClient) CreateUserActionReason(userActionReasonId string, req // string userConsentId (Optional) The Id for the User consent. If not provided a secure random UUID will be generated. // UserConsentRequest request The request that contains the user consent information. func (c *FusionAuthClient) CreateUserConsent(userConsentId string, request UserConsentRequest) (*UserConsentResponse, *Errors, error) { - var resp UserConsentResponse - var errors Errors + var resp UserConsentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/consent"). - WithUriSegment(userConsentId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/consent"). + WithUriSegment(userConsentId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // CreateWebhook @@ -608,93 +608,93 @@ func (c *FusionAuthClient) CreateUserConsent(userConsentId string, request UserC // string webhookId (Optional) The Id for the webhook. If not provided a secure random UUID will be generated. // WebhookRequest request The request object that contains all of the information used to create the webhook. func (c *FusionAuthClient) CreateWebhook(webhookId string, request WebhookRequest) (*WebhookResponse, *Errors, error) { - var resp WebhookResponse - var errors Errors + var resp WebhookResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/webhook"). - WithUriSegment(webhookId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/webhook"). + WithUriSegment(webhookId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeactivateApplication // Deactivates the application with the given Id. // string applicationId The Id of the application to deactivate. func (c *FusionAuthClient) DeactivateApplication(applicationId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeactivateUser // Deactivates the user with the given Id. // string userId The Id of the user to deactivate. func (c *FusionAuthClient) DeactivateUser(userId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeactivateUserAction // Deactivates the user action with the given Id. // string userActionId The Id of the user action to deactivate. func (c *FusionAuthClient) DeactivateUserAction(userActionId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeactivateUsers // Deactivates the users with the given ids. // []string userIds The ids of the users to deactivate. func (c *FusionAuthClient) DeactivateUsers(userIds []string) (*UserDeleteResponse, *Errors, error) { - var resp UserDeleteResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/bulk"). - WithParameter("userId", userIds). - WithParameter("dryRun", strconv.FormatBool(false)). - WithParameter("hardDelete", strconv.FormatBool(false)). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp UserDeleteResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/bulk"). + WithParameter("userId", userIds). + WithParameter("dryRun", strconv.FormatBool(false)). + WithParameter("hardDelete", strconv.FormatBool(false)). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeactivateUsersByQuery @@ -702,20 +702,20 @@ func (c *FusionAuthClient) DeactivateUsers(userIds []string) (*UserDeleteRespons // string queryString The search query string. // bool dryRun Whether to preview or deactivate the users found by the queryString func (c *FusionAuthClient) DeactivateUsersByQuery(queryString string, dryRun bool) (*UserDeleteResponse, *Errors, error) { - var resp UserDeleteResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/bulk"). - WithParameter("queryString", queryString). - WithParameter("dryRun", strconv.FormatBool(dryRun)). - WithParameter("hardDelete", strconv.FormatBool(false)). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp UserDeleteResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/bulk"). + WithParameter("queryString", queryString). + WithParameter("dryRun", strconv.FormatBool(dryRun)). + WithParameter("hardDelete", strconv.FormatBool(false)). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteApplication @@ -725,19 +725,19 @@ func (c *FusionAuthClient) DeactivateUsersByQuery(queryString string, dryRun boo // long time, depending on the amount of data in your database. // string applicationId The Id of the application to delete. func (c *FusionAuthClient) DeleteApplication(applicationId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithParameter("hardDelete", strconv.FormatBool(true)). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithParameter("hardDelete", strconv.FormatBool(true)). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteApplicationRole @@ -746,146 +746,146 @@ func (c *FusionAuthClient) DeleteApplication(applicationId string) (*BaseHTTPRes // string applicationId The Id of the application to deactivate. // string roleId The Id of the role to delete. func (c *FusionAuthClient) DeleteApplicationRole(applicationId string, roleId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithUriSegment("role"). - WithUriSegment(roleId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp BaseHTTPResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithUriSegment("role"). + WithUriSegment(roleId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteConsent // Deletes the consent for the given Id. // string consentId The Id of the consent to delete. func (c *FusionAuthClient) DeleteConsent(consentId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/consent"). - WithUriSegment(consentId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/consent"). + WithUriSegment(consentId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteEmailTemplate // Deletes the email template for the given Id. // string emailTemplateId The Id of the email template to delete. func (c *FusionAuthClient) DeleteEmailTemplate(emailTemplateId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/email/template"). - WithUriSegment(emailTemplateId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/email/template"). + WithUriSegment(emailTemplateId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteGroup // Deletes the group for the given Id. // string groupId The Id of the group to delete. func (c *FusionAuthClient) DeleteGroup(groupId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group"). - WithUriSegment(groupId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group"). + WithUriSegment(groupId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteGroupMembers // Removes users as members of a group. // MemberDeleteRequest request The member request that contains all of the information used to remove members to the group. func (c *FusionAuthClient) DeleteGroupMembers(request MemberDeleteRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group/member"). - WithJSONBody(request). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group/member"). + WithJSONBody(request). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteIdentityProvider // Deletes the identity provider for the given Id. // string identityProviderId The Id of the identity provider to delete. func (c *FusionAuthClient) DeleteIdentityProvider(identityProviderId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/identity-provider"). - WithUriSegment(identityProviderId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/identity-provider"). + WithUriSegment(identityProviderId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteKey // Deletes the key for the given Id. // string keyOd The Id of the key to delete. func (c *FusionAuthClient) DeleteKey(keyOd string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/key"). - WithUriSegment(keyOd). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/key"). + WithUriSegment(keyOd). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteLambda // Deletes the lambda for the given Id. // string lambdaId The Id of the lambda to delete. func (c *FusionAuthClient) DeleteLambda(lambdaId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/lambda"). - WithUriSegment(lambdaId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/lambda"). + WithUriSegment(lambdaId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteRegistration @@ -893,55 +893,55 @@ func (c *FusionAuthClient) DeleteLambda(lambdaId string) (*BaseHTTPResponse, *Er // string userId The Id of the user whose registration is being deleted. // string applicationId The Id of the application to remove the registration for. func (c *FusionAuthClient) DeleteRegistration(userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/registration"). - WithUriSegment(userId). - WithUriSegment(applicationId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/registration"). + WithUriSegment(userId). + WithUriSegment(applicationId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteTenant // Deletes the tenant for the given Id. // string tenantId The Id of the tenant to delete. func (c *FusionAuthClient) DeleteTenant(tenantId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/tenant"). - WithUriSegment(tenantId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant"). + WithUriSegment(tenantId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteTheme // Deletes the theme for the given Id. // string themeId The Id of the theme to delete. func (c *FusionAuthClient) DeleteTheme(themeId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/theme"). - WithUriSegment(themeId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/theme"). + WithUriSegment(themeId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteUser @@ -949,19 +949,19 @@ func (c *FusionAuthClient) DeleteTheme(themeId string) (*BaseHTTPResponse, *Erro // with the user. // string userId The Id of the user to delete. func (c *FusionAuthClient) DeleteUser(userId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithParameter("hardDelete", strconv.FormatBool(true)). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithParameter("hardDelete", strconv.FormatBool(true)). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteUserAction @@ -969,57 +969,57 @@ func (c *FusionAuthClient) DeleteUser(userId string) (*BaseHTTPResponse, *Errors // the action being applied to any users. // string userActionId The Id of the user action to delete. func (c *FusionAuthClient) DeleteUserAction(userActionId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithParameter("hardDelete", strconv.FormatBool(true)). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithParameter("hardDelete", strconv.FormatBool(true)). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteUserActionReason // Deletes the user action reason for the given Id. // string userActionReasonId The Id of the user action reason to delete. func (c *FusionAuthClient) DeleteUserActionReason(userActionReasonId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action-reason"). - WithUriSegment(userActionReasonId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action-reason"). + WithUriSegment(userActionReasonId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteUsers // Deletes the users with the given ids, or users matching the provided queryString. -// If you provide both userIds and queryString, the userIds will be honored. This can be used to deactivate or hard-delete +// If you provide both userIds and queryString, the userIds will be honored. This can be used to deactivate or hard-delete // a user based on the hardDelete request body parameter. // UserDeleteRequest request The UserDeleteRequest. func (c *FusionAuthClient) DeleteUsers(request UserDeleteRequest) (*UserDeleteResponse, *Errors, error) { - var resp UserDeleteResponse - var errors Errors + var resp UserDeleteResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/bulk"). - WithJSONBody(request). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/bulk"). + WithJSONBody(request). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteUsersByQuery @@ -1027,38 +1027,38 @@ func (c *FusionAuthClient) DeleteUsers(request UserDeleteRequest) (*UserDeleteRe // string queryString The search query string. // bool dryRun Whether to preview or delete the users found by the queryString func (c *FusionAuthClient) DeleteUsersByQuery(queryString string, dryRun bool) (*UserDeleteResponse, *Errors, error) { - var resp UserDeleteResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/bulk"). - WithParameter("queryString", queryString). - WithParameter("dryRun", strconv.FormatBool(dryRun)). - WithParameter("hardDelete", strconv.FormatBool(true)). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp UserDeleteResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/bulk"). + WithParameter("queryString", queryString). + WithParameter("dryRun", strconv.FormatBool(dryRun)). + WithParameter("hardDelete", strconv.FormatBool(true)). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DeleteWebhook // Deletes the webhook for the given Id. // string webhookId The Id of the webhook to delete. func (c *FusionAuthClient) DeleteWebhook(webhookId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/webhook"). - WithUriSegment(webhookId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/webhook"). + WithUriSegment(webhookId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // DisableTwoFactor @@ -1066,19 +1066,19 @@ func (c *FusionAuthClient) DeleteWebhook(webhookId string) (*BaseHTTPResponse, * // string userId The Id of the User for which you're disabling Two Factor authentication. // string code The Two Factor code used verify the the caller knows the Two Factor secret. func (c *FusionAuthClient) DisableTwoFactor(userId string, code string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/two-factor"). - WithParameter("userId", userId). - WithParameter("code", code). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/two-factor"). + WithParameter("userId", userId). + WithParameter("code", code). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // EnableTwoFactor @@ -1086,19 +1086,19 @@ func (c *FusionAuthClient) DisableTwoFactor(userId string, code string) (*BaseHT // string userId The Id of the user to enable Two Factor authentication. // TwoFactorRequest request The two factor enable request information. func (c *FusionAuthClient) EnableTwoFactor(userId string, request TwoFactorRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/two-factor"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/two-factor"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ExchangeOAuthCodeForAccessToken @@ -1109,24 +1109,24 @@ func (c *FusionAuthClient) EnableTwoFactor(userId string, request TwoFactorReque // string clientSecret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header. // string redirectUri The URI to redirect to upon a successful request. func (c *FusionAuthClient) ExchangeOAuthCodeForAccessToken(code string, clientId string, clientSecret string, redirectUri string) (*AccessToken, *OAuthError, error) { - var resp AccessToken - var errors OAuthError - formBody := url.Values{} - formBody.Set("code", code) - formBody.Set("client_id", clientId) - formBody.Set("client_secret", clientSecret) - formBody.Set("grant_type", "authorization_code") - formBody.Set("redirect_uri", redirectUri) - - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/oauth2/token"). - WithFormData(formBody). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp AccessToken + var errors OAuthError + formBody := url.Values{} + formBody.Set("code", code) + formBody.Set("client_id", clientId) + formBody.Set("client_secret", clientSecret) + formBody.Set("grant_type", "authorization_code") + formBody.Set("redirect_uri", redirectUri) + + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/oauth2/token"). + WithFormData(formBody). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ExchangeRefreshTokenForAccessToken @@ -1138,43 +1138,43 @@ func (c *FusionAuthClient) ExchangeOAuthCodeForAccessToken(code string, clientId // 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. // string userCode (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization. func (c *FusionAuthClient) ExchangeRefreshTokenForAccessToken(refreshToken string, clientId string, clientSecret string, scope string, userCode string) (*AccessToken, *OAuthError, error) { - var resp AccessToken - var errors OAuthError - formBody := url.Values{} - formBody.Set("refresh_token", refreshToken) - formBody.Set("client_id", clientId) - formBody.Set("client_secret", clientSecret) - formBody.Set("grant_type", "refresh_token") - formBody.Set("scope", scope) - formBody.Set("user_code", userCode) - - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/oauth2/token"). - WithFormData(formBody). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp AccessToken + var errors OAuthError + formBody := url.Values{} + formBody.Set("refresh_token", refreshToken) + formBody.Set("client_id", clientId) + formBody.Set("client_secret", clientSecret) + formBody.Set("grant_type", "refresh_token") + formBody.Set("scope", scope) + formBody.Set("user_code", userCode) + + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/oauth2/token"). + WithFormData(formBody). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ExchangeRefreshTokenForJWT // Exchange a refresh token for a new JWT. // RefreshRequest request The refresh request. func (c *FusionAuthClient) ExchangeRefreshTokenForJWT(request RefreshRequest) (*RefreshResponse, *Errors, error) { - var resp RefreshResponse - var errors Errors + var resp RefreshResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/jwt/refresh"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/jwt/refresh"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ExchangeUserCredentialsForAccessToken @@ -1187,44 +1187,44 @@ func (c *FusionAuthClient) ExchangeRefreshTokenForJWT(request RefreshRequest) (* // 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. // string userCode (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization. func (c *FusionAuthClient) ExchangeUserCredentialsForAccessToken(username string, password string, clientId string, clientSecret string, scope string, userCode string) (*AccessToken, *OAuthError, error) { - var resp AccessToken - var errors OAuthError - formBody := url.Values{} - formBody.Set("username", username) - formBody.Set("password", password) - formBody.Set("client_id", clientId) - formBody.Set("client_secret", clientSecret) - formBody.Set("grant_type", "password") - formBody.Set("scope", scope) - formBody.Set("user_code", userCode) - - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/oauth2/token"). - WithFormData(formBody). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp AccessToken + var errors OAuthError + formBody := url.Values{} + formBody.Set("username", username) + formBody.Set("password", password) + formBody.Set("client_id", clientId) + formBody.Set("client_secret", clientSecret) + formBody.Set("grant_type", "password") + formBody.Set("scope", scope) + formBody.Set("user_code", userCode) + + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/oauth2/token"). + WithFormData(formBody). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ForgotPassword // Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password. // ForgotPasswordRequest request The request that contains the information about the user so that they can be emailed. func (c *FusionAuthClient) ForgotPassword(request ForgotPasswordRequest) (*ForgotPasswordResponse, *Errors, error) { - var resp ForgotPasswordResponse - var errors Errors + var resp ForgotPasswordResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user/forgot-password"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/forgot-password"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // GenerateEmailVerificationId @@ -1232,15 +1232,15 @@ func (c *FusionAuthClient) ForgotPassword(request ForgotPasswordRequest) (*Forgo // email to the User. This API may be used to collect the verificationId for use with a third party system. // string email The email address of the user that needs a new verification email. func (c *FusionAuthClient) GenerateEmailVerificationId(email string) (*VerifyEmailResponse, error) { - var resp VerifyEmailResponse + var resp VerifyEmailResponse - err := c.Start(&resp, nil). - WithUri("/api/user/verify-email"). - WithParameter("email", email). - WithParameter("sendVerifyEmail", strconv.FormatBool(false)). - WithMethod(http.MethodPut). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/verify-email"). + WithParameter("email", email). + WithParameter("sendVerifyEmail", strconv.FormatBool(false)). + WithMethod(http.MethodPut). + Do() + return &resp, err } // GenerateKey @@ -1248,19 +1248,19 @@ func (c *FusionAuthClient) GenerateEmailVerificationId(email string) (*VerifyEma // string keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated. // KeyRequest request The request object that contains all of the information used to create the key. func (c *FusionAuthClient) GenerateKey(keyId string, request KeyRequest) (*KeyResponse, *Errors, error) { - var resp KeyResponse - var errors Errors + var resp KeyResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/key/generate"). - WithUriSegment(keyId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/key/generate"). + WithUriSegment(keyId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // GenerateRegistrationVerificationId @@ -1269,16 +1269,16 @@ func (c *FusionAuthClient) GenerateKey(keyId string, request KeyRequest) (*KeyRe // string email The email address of the user that needs a new verification email. // string applicationId The Id of the application to be verified. func (c *FusionAuthClient) GenerateRegistrationVerificationId(email string, applicationId string) (*VerifyRegistrationResponse, error) { - var resp VerifyRegistrationResponse + var resp VerifyRegistrationResponse - err := c.Start(&resp, nil). - WithUri("/api/user/verify-registration"). - WithParameter("email", email). - WithParameter("sendVerifyPasswordEmail", strconv.FormatBool(false)). - WithParameter("applicationId", applicationId). - WithMethod(http.MethodPut). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/verify-registration"). + WithParameter("email", email). + WithParameter("sendVerifyPasswordEmail", strconv.FormatBool(false)). + WithParameter("applicationId", applicationId). + WithMethod(http.MethodPut). + Do() + return &resp, err } // GenerateTwoFactorSecret @@ -1286,13 +1286,13 @@ func (c *FusionAuthClient) GenerateRegistrationVerificationId(email string, appl // both the secret and a Base32 encoded form of the secret which can be shown to a User when using a 2 Step Authentication // application such as Google Authenticator. func (c *FusionAuthClient) GenerateTwoFactorSecret() (*SecretResponse, error) { - var resp SecretResponse + var resp SecretResponse - err := c.Start(&resp, nil). - WithUri("/api/two-factor/secret"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/two-factor/secret"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // GenerateTwoFactorSecretUsingJWT @@ -1301,14 +1301,14 @@ func (c *FusionAuthClient) GenerateTwoFactorSecret() (*SecretResponse, error) { // application such as Google Authenticator. // string encodedJWT The encoded JWT (access token). func (c *FusionAuthClient) GenerateTwoFactorSecretUsingJWT(encodedJWT string) (*SecretResponse, error) { - var resp SecretResponse + var resp SecretResponse - err := c.Start(&resp, nil). - WithUri("/api/two-factor/secret"). - WithAuthorization("JWT " + encodedJWT). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/two-factor/secret"). + WithAuthorization("JWT " + encodedJWT). + WithMethod(http.MethodGet). + Do() + return &resp, err } // IdentityProviderLogin @@ -1317,18 +1317,18 @@ func (c *FusionAuthClient) GenerateTwoFactorSecretUsingJWT(encodedJWT string) (* // IdentityProviderLoginRequest request The third-party login request that contains information from the third-party login // providers that FusionAuth uses to reconcile the user's account. func (c *FusionAuthClient) IdentityProviderLogin(request IdentityProviderLoginRequest) (*LoginResponse, *Errors, error) { - var resp LoginResponse - var errors Errors + var resp LoginResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/identity-provider/login"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/identity-provider/login"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ImportKey @@ -1336,19 +1336,19 @@ func (c *FusionAuthClient) IdentityProviderLogin(request IdentityProviderLoginRe // string keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated. // KeyRequest request The request object that contains all of the information used to create the key. func (c *FusionAuthClient) ImportKey(keyId string, request KeyRequest) (*KeyResponse, *Errors, error) { - var resp KeyResponse - var errors Errors + var resp KeyResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/key/import"). - WithUriSegment(keyId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/key/import"). + WithUriSegment(keyId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ImportUsers @@ -1357,18 +1357,18 @@ func (c *FusionAuthClient) ImportKey(keyId string, request KeyRequest) (*KeyResp // but it will likely be pretty generic. // ImportRequest request The request that contains all of the information about all of the users to import. func (c *FusionAuthClient) ImportUsers(request ImportRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/import"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/import"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // IssueJWT @@ -1380,39 +1380,39 @@ func (c *FusionAuthClient) ImportUsers(request ImportRequest) (*BaseHTTPResponse // string applicationId The Application Id for which you are requesting a new access token be issued. // string encodedJWT The encoded JWT (access token). func (c *FusionAuthClient) IssueJWT(applicationId string, encodedJWT string) (*IssueResponse, *Errors, error) { - var resp IssueResponse - var errors Errors + var resp IssueResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/jwt/issue"). - WithAuthorization("JWT " + encodedJWT). - WithParameter("applicationId", applicationId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/jwt/issue"). + WithAuthorization("JWT "+encodedJWT). + WithParameter("applicationId", applicationId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // Login -// Authenticates a user to FusionAuth. -// +// Authenticates a user to FusionAuth. +// // This API optionally requires an API key. See Application.loginConfiguration.requireAuthentication. // LoginRequest request The login request that contains the user credentials used to log them in. func (c *FusionAuthClient) Login(request LoginRequest) (*LoginResponse, *Errors, error) { - var resp LoginResponse - var errors Errors + var resp LoginResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/login"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/login"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // LoginPing @@ -1425,20 +1425,20 @@ func (c *FusionAuthClient) Login(request LoginRequest) (*LoginResponse, *Errors, // string callerIPAddress (Optional) The IP address of the end-user that is logging in. If a null value is provided // the IP address will be that of the client or last proxy that sent the request. func (c *FusionAuthClient) LoginPing(userId string, applicationId string, callerIPAddress string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/login"). - WithUriSegment(userId). - WithUriSegment(applicationId). - WithParameter("ipAddress", callerIPAddress). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp BaseHTTPResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/login"). + WithUriSegment(userId). + WithUriSegment(applicationId). + WithParameter("ipAddress", callerIPAddress). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // Logout @@ -1450,15 +1450,15 @@ func (c *FusionAuthClient) LoginPing(userId string, applicationId string, caller // string refreshToken (Optional) The refresh_token as a request parameter instead of coming in via a cookie. // If provided this takes precedence over the cookie. func (c *FusionAuthClient) Logout(global bool, refreshToken string) (*BaseHTTPResponse, error) { - var resp BaseHTTPResponse + var resp BaseHTTPResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/logout"). - WithParameter("global", strconv.FormatBool(global)). - WithParameter("refreshToken", refreshToken). - WithMethod(http.MethodPost). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/logout"). + WithParameter("global", strconv.FormatBool(global)). + WithParameter("refreshToken", refreshToken). + WithMethod(http.MethodPost). + Do() + return &resp, err } // LookupIdentityProvider @@ -1466,14 +1466,14 @@ func (c *FusionAuthClient) Logout(global bool, refreshToken string) (*BaseHTTPRe // by a registered identity provider. A 404 indicates the domain is not managed. // string domain The domain or email address to lookup. func (c *FusionAuthClient) LookupIdentityProvider(domain string) (*LookupResponse, error) { - var resp LookupResponse + var resp LookupResponse - err := c.Start(&resp, nil). - WithUri("/api/identity-provider/lookup"). - WithParameter("domain", domain). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/identity-provider/lookup"). + WithParameter("domain", domain). + WithMethod(http.MethodGet). + Do() + return &resp, err } // ModifyAction @@ -1482,37 +1482,37 @@ func (c *FusionAuthClient) LookupIdentityProvider(domain string) (*LookupRespons // string actionId The Id of the action to modify. This is technically the user action log id. // ActionRequest request The request that contains all of the information about the modification. func (c *FusionAuthClient) ModifyAction(actionId string, request ActionRequest) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithUriSegment(actionId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithUriSegment(actionId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PasswordlessLogin // Complete a login request using a passwordless code // PasswordlessLoginRequest request The passwordless login request that contains all of the information used to complete login. func (c *FusionAuthClient) PasswordlessLogin(request PasswordlessLoginRequest) (*LoginResponse, *Errors, error) { - var resp LoginResponse - var errors Errors + var resp LoginResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/passwordless/login"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/passwordless/login"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchApplication @@ -1520,19 +1520,19 @@ func (c *FusionAuthClient) PasswordlessLogin(request PasswordlessLoginRequest) ( // string applicationId The Id of the application to update. // ApplicationRequest request The request that contains just the new application information. func (c *FusionAuthClient) PatchApplication(applicationId string, request map[string]interface{}) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors + var resp ApplicationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchApplicationRole @@ -1541,21 +1541,21 @@ func (c *FusionAuthClient) PatchApplication(applicationId string, request map[st // string roleId The Id of the role to update. // ApplicationRequest request The request that contains just the new role information. func (c *FusionAuthClient) PatchApplicationRole(applicationId string, roleId string, request map[string]interface{}) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithUriSegment("role"). - WithUriSegment(roleId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp ApplicationResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithUriSegment("role"). + WithUriSegment(roleId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchConsent @@ -1563,19 +1563,19 @@ func (c *FusionAuthClient) PatchApplicationRole(applicationId string, roleId str // string consentId The Id of the consent to update. // ConsentRequest request The request that contains just the new consent information. func (c *FusionAuthClient) PatchConsent(consentId string, request map[string]interface{}) (*ConsentResponse, *Errors, error) { - var resp ConsentResponse - var errors Errors + var resp ConsentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/consent"). - WithUriSegment(consentId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/consent"). + WithUriSegment(consentId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchEmailTemplate @@ -1583,19 +1583,19 @@ func (c *FusionAuthClient) PatchConsent(consentId string, request map[string]int // string emailTemplateId The Id of the email template to update. // EmailTemplateRequest request The request that contains just the new email template information. func (c *FusionAuthClient) PatchEmailTemplate(emailTemplateId string, request map[string]interface{}) (*EmailTemplateResponse, *Errors, error) { - var resp EmailTemplateResponse - var errors Errors + var resp EmailTemplateResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/email/template"). - WithUriSegment(emailTemplateId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/email/template"). + WithUriSegment(emailTemplateId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchGroup @@ -1603,19 +1603,19 @@ func (c *FusionAuthClient) PatchEmailTemplate(emailTemplateId string, request ma // string groupId The Id of the group to update. // GroupRequest request The request that contains just the new group information. func (c *FusionAuthClient) PatchGroup(groupId string, request map[string]interface{}) (*GroupResponse, *Errors, error) { - var resp GroupResponse - var errors Errors + var resp GroupResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group"). - WithUriSegment(groupId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group"). + WithUriSegment(groupId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchIdentityProvider @@ -1623,37 +1623,37 @@ func (c *FusionAuthClient) PatchGroup(groupId string, request map[string]interfa // string identityProviderId The Id of the identity provider to update. // IdentityProviderRequest request The request object that contains just the updated identity provider information. func (c *FusionAuthClient) PatchIdentityProvider(identityProviderId string, request map[string]interface{}) (*IdentityProviderResponse, *Errors, error) { - var resp IdentityProviderResponse - var errors Errors + var resp IdentityProviderResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/identity-provider"). - WithUriSegment(identityProviderId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/identity-provider"). + WithUriSegment(identityProviderId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchIntegrations // Updates, via PATCH, the available integrations. // IntegrationRequest request The request that contains just the new integration information. func (c *FusionAuthClient) PatchIntegrations(request map[string]interface{}) (*IntegrationResponse, *Errors, error) { - var resp IntegrationResponse - var errors Errors + var resp IntegrationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/integration"). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/integration"). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchLambda @@ -1661,19 +1661,19 @@ func (c *FusionAuthClient) PatchIntegrations(request map[string]interface{}) (*I // string lambdaId The Id of the lambda to update. // LambdaRequest request The request that contains just the new lambda information. func (c *FusionAuthClient) PatchLambda(lambdaId string, request map[string]interface{}) (*LambdaResponse, *Errors, error) { - var resp LambdaResponse - var errors Errors + var resp LambdaResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/lambda"). - WithUriSegment(lambdaId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/lambda"). + WithUriSegment(lambdaId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchRegistration @@ -1681,37 +1681,37 @@ func (c *FusionAuthClient) PatchLambda(lambdaId string, request map[string]inter // string userId The Id of the user whose registration is going to be updated. // RegistrationRequest request The request that contains just the new registration information. func (c *FusionAuthClient) PatchRegistration(userId string, request map[string]interface{}) (*RegistrationResponse, *Errors, error) { - var resp RegistrationResponse - var errors Errors + var resp RegistrationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/registration"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/registration"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchSystemConfiguration // Updates, via PATCH, the system configuration. // SystemConfigurationRequest request The request that contains just the new system configuration information. func (c *FusionAuthClient) PatchSystemConfiguration(request map[string]interface{}) (*SystemConfigurationResponse, *Errors, error) { - var resp SystemConfigurationResponse - var errors Errors + var resp SystemConfigurationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/system-configuration"). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/system-configuration"). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchTenant @@ -1719,19 +1719,19 @@ func (c *FusionAuthClient) PatchSystemConfiguration(request map[string]interface // string tenantId The Id of the tenant to update. // TenantRequest request The request that contains just the new tenant information. func (c *FusionAuthClient) PatchTenant(tenantId string, request map[string]interface{}) (*TenantResponse, *Errors, error) { - var resp TenantResponse - var errors Errors + var resp TenantResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/tenant"). - WithUriSegment(tenantId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant"). + WithUriSegment(tenantId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchTheme @@ -1739,19 +1739,19 @@ func (c *FusionAuthClient) PatchTenant(tenantId string, request map[string]inter // string themeId The Id of the theme to update. // ThemeRequest request The request that contains just the new theme information. func (c *FusionAuthClient) PatchTheme(themeId string, request map[string]interface{}) (*ThemeResponse, *Errors, error) { - var resp ThemeResponse - var errors Errors + var resp ThemeResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/theme"). - WithUriSegment(themeId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/theme"). + WithUriSegment(themeId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchUser @@ -1759,19 +1759,19 @@ func (c *FusionAuthClient) PatchTheme(themeId string, request map[string]interfa // string userId The Id of the user to update. // UserRequest request The request that contains just the new user information. func (c *FusionAuthClient) PatchUser(userId string, request map[string]interface{}) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchUserAction @@ -1779,19 +1779,19 @@ func (c *FusionAuthClient) PatchUser(userId string, request map[string]interface // string userActionId The Id of the user action to update. // UserActionRequest request The request that contains just the new user action information. func (c *FusionAuthClient) PatchUserAction(userActionId string, request map[string]interface{}) (*UserActionResponse, *Errors, error) { - var resp UserActionResponse - var errors Errors + var resp UserActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchUserActionReason @@ -1799,19 +1799,19 @@ func (c *FusionAuthClient) PatchUserAction(userActionId string, request map[stri // string userActionReasonId The Id of the user action reason to update. // UserActionReasonRequest request The request that contains just the new user action reason information. func (c *FusionAuthClient) PatchUserActionReason(userActionReasonId string, request map[string]interface{}) (*UserActionReasonResponse, *Errors, error) { - var resp UserActionReasonResponse - var errors Errors + var resp UserActionReasonResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action-reason"). - WithUriSegment(userActionReasonId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action-reason"). + WithUriSegment(userActionReasonId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // PatchUserConsent @@ -1819,113 +1819,113 @@ func (c *FusionAuthClient) PatchUserActionReason(userActionReasonId string, requ // string userConsentId The User Consent Id // UserConsentRequest request The request that contains just the new user consent information. func (c *FusionAuthClient) PatchUserConsent(userConsentId string, request map[string]interface{}) (*UserConsentResponse, *Errors, error) { - var resp UserConsentResponse - var errors Errors + var resp UserConsentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/consent"). - WithUriSegment(userConsentId). - WithJSONBody(request). - WithMethod(http.MethodPatch). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/consent"). + WithUriSegment(userConsentId). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ReactivateApplication // Reactivates the application with the given Id. // string applicationId The Id of the application to reactivate. func (c *FusionAuthClient) ReactivateApplication(applicationId string) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors + var resp ApplicationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithParameter("reactivate", strconv.FormatBool(true)). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithParameter("reactivate", strconv.FormatBool(true)). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ReactivateUser // Reactivates the user with the given Id. // string userId The Id of the user to reactivate. func (c *FusionAuthClient) ReactivateUser(userId string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithParameter("reactivate", strconv.FormatBool(true)). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithParameter("reactivate", strconv.FormatBool(true)). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ReactivateUserAction // Reactivates the user action with the given Id. // string userActionId The Id of the user action to reactivate. func (c *FusionAuthClient) ReactivateUserAction(userActionId string) (*UserActionResponse, *Errors, error) { - var resp UserActionResponse - var errors Errors + var resp UserActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithParameter("reactivate", strconv.FormatBool(true)). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithParameter("reactivate", strconv.FormatBool(true)). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ReconcileJWT // Reconcile a User to FusionAuth using JWT issued from another Identity Provider. // IdentityProviderLoginRequest request The reconcile request that contains the data to reconcile the User. func (c *FusionAuthClient) ReconcileJWT(request IdentityProviderLoginRequest) (*LoginResponse, *Errors, error) { - var resp LoginResponse - var errors Errors + var resp LoginResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/jwt/reconcile"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/jwt/reconcile"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RefreshUserSearchIndex // Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a -// reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be +// reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be // 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 // ensure the index immediately current before making a query request to the search index. func (c *FusionAuthClient) RefreshUserSearchIndex() (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/search"). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/search"). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // Register @@ -1937,19 +1937,19 @@ func (c *FusionAuthClient) RefreshUserSearchIndex() (*BaseHTTPResponse, *Errors, // string userId (Optional) The Id of the user being registered for the application and optionally created. // RegistrationRequest request The request that optionally contains the User and must contain the UserRegistration. func (c *FusionAuthClient) Register(userId string, request RegistrationRequest) (*RegistrationResponse, *Errors, error) { - var resp RegistrationResponse - var errors Errors + var resp RegistrationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/registration"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/registration"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RemoveUserFromFamily @@ -1957,37 +1957,37 @@ func (c *FusionAuthClient) Register(userId string, request RegistrationRequest) // string familyId The id of the family to remove the user from. // string userId The id of the user to remove from the family. func (c *FusionAuthClient) RemoveUserFromFamily(familyId string, userId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/family"). - WithUriSegment(familyId). - WithUriSegment(userId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/family"). + WithUriSegment(familyId). + WithUriSegment(userId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ResendEmailVerification // Re-sends the verification email to the user. // string email The email address of the user that needs a new verification email. func (c *FusionAuthClient) ResendEmailVerification(email string) (*VerifyEmailResponse, *Errors, error) { - var resp VerifyEmailResponse - var errors Errors + var resp VerifyEmailResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user/verify-email"). - WithParameter("email", email). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/verify-email"). + WithParameter("email", email). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ResendRegistrationVerification @@ -1995,37 +1995,37 @@ func (c *FusionAuthClient) ResendEmailVerification(email string) (*VerifyEmailRe // string email The email address of the user that needs a new verification email. // string applicationId The Id of the application to be verified. func (c *FusionAuthClient) ResendRegistrationVerification(email string, applicationId string) (*VerifyRegistrationResponse, *Errors, error) { - var resp VerifyRegistrationResponse - var errors Errors + var resp VerifyRegistrationResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user/verify-registration"). - WithParameter("email", email). - WithParameter("applicationId", applicationId). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/user/verify-registration"). + WithParameter("email", email). + WithParameter("applicationId", applicationId). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveAction // Retrieves a single action log (the log of a user action that was taken on a user previously) for the given Id. // string actionId The Id of the action to retrieve. func (c *FusionAuthClient) RetrieveAction(actionId string) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithUriSegment(actionId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithUriSegment(actionId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveActions @@ -2033,37 +2033,37 @@ func (c *FusionAuthClient) RetrieveAction(actionId string) (*ActionResponse, *Er // and inactive as well as non-time based actions. // string userId The Id of the user to fetch the actions for. func (c *FusionAuthClient) RetrieveActions(userId string) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithParameter("userId", userId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithParameter("userId", userId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveActionsPreventingLogin // Retrieves all of the actions for the user with the given Id that are currently preventing the User from logging in. // string userId The Id of the user to fetch the actions for. func (c *FusionAuthClient) RetrieveActionsPreventingLogin(userId string) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithParameter("userId", userId). - WithParameter("preventingLogin", strconv.FormatBool(true)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithParameter("userId", userId). + WithParameter("preventingLogin", strconv.FormatBool(true)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveActiveActions @@ -2071,89 +2071,89 @@ func (c *FusionAuthClient) RetrieveActionsPreventingLogin(userId string) (*Actio // An active action means one that is time based and has not been canceled, and has not ended. // string userId The Id of the user to fetch the actions for. func (c *FusionAuthClient) RetrieveActiveActions(userId string) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithParameter("userId", userId). - WithParameter("active", strconv.FormatBool(true)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithParameter("userId", userId). + WithParameter("active", strconv.FormatBool(true)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveApplication // Retrieves the application for the given id or all of the applications if the id is null. // string applicationId (Optional) The application id. func (c *FusionAuthClient) RetrieveApplication(applicationId string) (*ApplicationResponse, error) { - var resp ApplicationResponse + var resp ApplicationResponse - err := c.Start(&resp, nil). - WithUri("/api/application"). - WithUriSegment(applicationId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/application"). + WithUriSegment(applicationId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveApplications // Retrieves all of the applications. func (c *FusionAuthClient) RetrieveApplications() (*ApplicationResponse, error) { - var resp ApplicationResponse + var resp ApplicationResponse - err := c.Start(&resp, nil). - WithUri("/api/application"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/application"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveAuditLog // Retrieves a single audit log for the given Id. // int auditLogId The Id of the audit log to retrieve. func (c *FusionAuthClient) RetrieveAuditLog(auditLogId int) (*AuditLogResponse, *Errors, error) { - var resp AuditLogResponse - var errors Errors + var resp AuditLogResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/system/audit-log"). - WithUriSegment(string(auditLogId)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/system/audit-log"). + WithUriSegment(string(auditLogId)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveConsent // Retrieves the Consent for the given Id. // string consentId The Id of the consent. func (c *FusionAuthClient) RetrieveConsent(consentId string) (*ConsentResponse, error) { - var resp ConsentResponse + var resp ConsentResponse - err := c.Start(&resp, nil). - WithUri("/api/consent"). - WithUriSegment(consentId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/consent"). + WithUriSegment(consentId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveConsents // Retrieves all of the consent. func (c *FusionAuthClient) RetrieveConsents() (*ConsentResponse, error) { - var resp ConsentResponse + var resp ConsentResponse - err := c.Start(&resp, nil). - WithUri("/api/consent"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/consent"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveDailyActiveReport @@ -2163,34 +2163,34 @@ func (c *FusionAuthClient) RetrieveConsents() (*ConsentResponse, error) { // int64 start The start instant as UTC milliseconds since Epoch. // int64 end The end instant as UTC milliseconds since Epoch. func (c *FusionAuthClient) RetrieveDailyActiveReport(applicationId string, start int64, end int64) (*DailyActiveUserReportResponse, *Errors, error) { - var resp DailyActiveUserReportResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/report/daily-active-user"). - WithParameter("applicationId", applicationId). - WithParameter("start", strconv.FormatInt(start, 10)). - WithParameter("end", strconv.FormatInt(end, 10)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp DailyActiveUserReportResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/report/daily-active-user"). + WithParameter("applicationId", applicationId). + WithParameter("start", strconv.FormatInt(start, 10)). + WithParameter("end", strconv.FormatInt(end, 10)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveEmailTemplate // Retrieves the email template for the given Id. If you don't specify the id, this will return all of the email templates. // string emailTemplateId (Optional) The Id of the email template. func (c *FusionAuthClient) RetrieveEmailTemplate(emailTemplateId string) (*EmailTemplateResponse, error) { - var resp EmailTemplateResponse + var resp EmailTemplateResponse - err := c.Start(&resp, nil). - WithUri("/api/email/template"). - WithUriSegment(emailTemplateId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/email/template"). + WithUriSegment(emailTemplateId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveEmailTemplatePreview @@ -2199,106 +2199,106 @@ func (c *FusionAuthClient) RetrieveEmailTemplate(emailTemplateId string) (*Email // will create the preview based on whatever is given. // PreviewRequest request The request that contains the email template and optionally a locale to render it in. func (c *FusionAuthClient) RetrieveEmailTemplatePreview(request PreviewRequest) (*PreviewResponse, *Errors, error) { - var resp PreviewResponse - var errors Errors + var resp PreviewResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/email/template/preview"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/email/template/preview"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveEmailTemplates // Retrieves all of the email templates. func (c *FusionAuthClient) RetrieveEmailTemplates() (*EmailTemplateResponse, error) { - var resp EmailTemplateResponse + var resp EmailTemplateResponse - err := c.Start(&resp, nil). - WithUri("/api/email/template"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/email/template"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveEventLog // Retrieves a single event log for the given Id. // int eventLogId The Id of the event log to retrieve. func (c *FusionAuthClient) RetrieveEventLog(eventLogId int) (*EventLogResponse, *Errors, error) { - var resp EventLogResponse - var errors Errors + var resp EventLogResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/system/event-log"). - WithUriSegment(string(eventLogId)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/system/event-log"). + WithUriSegment(string(eventLogId)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveFamilies // Retrieves all of the families that a user belongs to. // string userId The User's id func (c *FusionAuthClient) RetrieveFamilies(userId string) (*FamilyResponse, error) { - var resp FamilyResponse + var resp FamilyResponse - err := c.Start(&resp, nil). - WithUri("/api/user/family"). - WithParameter("userId", userId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/family"). + WithParameter("userId", userId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveFamilyMembersByFamilyId // Retrieves all of the members of a family by the unique Family Id. // string familyId The unique Id of the Family. func (c *FusionAuthClient) RetrieveFamilyMembersByFamilyId(familyId string) (*FamilyResponse, error) { - var resp FamilyResponse + var resp FamilyResponse - err := c.Start(&resp, nil). - WithUri("/api/user/family"). - WithUriSegment(familyId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/family"). + WithUriSegment(familyId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveGroup // Retrieves the group for the given Id. // string groupId The Id of the group. func (c *FusionAuthClient) RetrieveGroup(groupId string) (*GroupResponse, *Errors, error) { - var resp GroupResponse - var errors Errors + var resp GroupResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group"). - WithUriSegment(groupId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group"). + WithUriSegment(groupId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveGroups // Retrieves all of the groups. func (c *FusionAuthClient) RetrieveGroups() (*GroupResponse, error) { - var resp GroupResponse + var resp GroupResponse - err := c.Start(&resp, nil). - WithUri("/api/group"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/group"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveInactiveActions @@ -2306,183 +2306,183 @@ func (c *FusionAuthClient) RetrieveGroups() (*GroupResponse, error) { // An inactive action means one that is time based and has been canceled or has expired, or is not time based. // string userId The Id of the user to fetch the actions for. func (c *FusionAuthClient) RetrieveInactiveActions(userId string) (*ActionResponse, *Errors, error) { - var resp ActionResponse - var errors Errors + var resp ActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/action"). - WithParameter("userId", userId). - WithParameter("active", strconv.FormatBool(false)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/action"). + WithParameter("userId", userId). + WithParameter("active", strconv.FormatBool(false)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveInactiveApplications // Retrieves all of the applications that are currently inactive. func (c *FusionAuthClient) RetrieveInactiveApplications() (*ApplicationResponse, error) { - var resp ApplicationResponse + var resp ApplicationResponse - err := c.Start(&resp, nil). - WithUri("/api/application"). - WithParameter("inactive", strconv.FormatBool(true)). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/application"). + WithParameter("inactive", strconv.FormatBool(true)). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveInactiveUserActions // Retrieves all of the user actions that are currently inactive. func (c *FusionAuthClient) RetrieveInactiveUserActions() (*UserActionResponse, error) { - var resp UserActionResponse + var resp UserActionResponse - err := c.Start(&resp, nil). - WithUri("/api/user-action"). - WithParameter("inactive", strconv.FormatBool(true)). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user-action"). + WithParameter("inactive", strconv.FormatBool(true)). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveIntegration // Retrieves the available integrations. func (c *FusionAuthClient) RetrieveIntegration() (*IntegrationResponse, error) { - var resp IntegrationResponse + var resp IntegrationResponse - err := c.Start(&resp, nil). - WithUri("/api/integration"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/integration"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveJWTPublicKey // Retrieves the Public Key configured for verifying JSON Web Tokens (JWT) by the key Id (kid). // string keyId The Id of the public key (kid). func (c *FusionAuthClient) RetrieveJWTPublicKey(keyId string) (*PublicKeyResponse, error) { - var resp PublicKeyResponse + var resp PublicKeyResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/jwt/public-key"). - WithParameter("kid", keyId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/jwt/public-key"). + WithParameter("kid", keyId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveJWTPublicKeyByApplicationId // Retrieves the Public Key configured for verifying the JSON Web Tokens (JWT) issued by the Login API by the Application Id. // string applicationId The Id of the Application for which this key is used. func (c *FusionAuthClient) RetrieveJWTPublicKeyByApplicationId(applicationId string) (*PublicKeyResponse, error) { - var resp PublicKeyResponse + var resp PublicKeyResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/jwt/public-key"). - WithParameter("applicationId", applicationId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/jwt/public-key"). + WithParameter("applicationId", applicationId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveJWTPublicKeys // Retrieves all Public Keys configured for verifying JSON Web Tokens (JWT). func (c *FusionAuthClient) RetrieveJWTPublicKeys() (*PublicKeyResponse, error) { - var resp PublicKeyResponse + var resp PublicKeyResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/jwt/public-key"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/jwt/public-key"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveJsonWebKeySet // Returns public keys used by FusionAuth to cryptographically verify JWTs using the JSON Web Key format. func (c *FusionAuthClient) RetrieveJsonWebKeySet() (*JWKSResponse, error) { - var resp JWKSResponse + var resp JWKSResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/.well-known/jwks.json"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/.well-known/jwks.json"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveKey // Retrieves the key for the given Id. // string keyId The Id of the key. func (c *FusionAuthClient) RetrieveKey(keyId string) (*KeyResponse, *Errors, error) { - var resp KeyResponse - var errors Errors + var resp KeyResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/key"). - WithUriSegment(keyId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/key"). + WithUriSegment(keyId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveKeys // Retrieves all of the keys. func (c *FusionAuthClient) RetrieveKeys() (*KeyResponse, error) { - var resp KeyResponse + var resp KeyResponse - err := c.Start(&resp, nil). - WithUri("/api/key"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/key"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveLambda // Retrieves the lambda for the given Id. // string lambdaId The Id of the lambda. func (c *FusionAuthClient) RetrieveLambda(lambdaId string) (*LambdaResponse, *Errors, error) { - var resp LambdaResponse - var errors Errors + var resp LambdaResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/lambda"). - WithUriSegment(lambdaId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/lambda"). + WithUriSegment(lambdaId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveLambdas // Retrieves all of the lambdas. func (c *FusionAuthClient) RetrieveLambdas() (*LambdaResponse, error) { - var resp LambdaResponse + var resp LambdaResponse - err := c.Start(&resp, nil). - WithUri("/api/lambda"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/lambda"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveLambdasByType // Retrieves all of the lambdas for the provided type. // LambdaType _type The type of the lambda to return. func (c *FusionAuthClient) RetrieveLambdasByType(_type LambdaType) (*LambdaResponse, error) { - var resp LambdaResponse + var resp LambdaResponse - err := c.Start(&resp, nil). - WithUri("/api/lambda"). - WithParameter("type", string(_type)). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/lambda"). + WithParameter("type", string(_type)). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveLoginReport @@ -2492,20 +2492,20 @@ func (c *FusionAuthClient) RetrieveLambdasByType(_type LambdaType) (*LambdaRespo // int64 start The start instant as UTC milliseconds since Epoch. // int64 end The end instant as UTC milliseconds since Epoch. func (c *FusionAuthClient) RetrieveLoginReport(applicationId string, start int64, end int64) (*LoginReportResponse, *Errors, error) { - var resp LoginReportResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/report/login"). - WithParameter("applicationId", applicationId). - WithParameter("start", strconv.FormatInt(start, 10)). - WithParameter("end", strconv.FormatInt(end, 10)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp LoginReportResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/report/login"). + WithParameter("applicationId", applicationId). + WithParameter("start", strconv.FormatInt(start, 10)). + WithParameter("end", strconv.FormatInt(end, 10)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveMonthlyActiveReport @@ -2515,100 +2515,100 @@ func (c *FusionAuthClient) RetrieveLoginReport(applicationId string, start int64 // int64 start The start instant as UTC milliseconds since Epoch. // int64 end The end instant as UTC milliseconds since Epoch. func (c *FusionAuthClient) RetrieveMonthlyActiveReport(applicationId string, start int64, end int64) (*MonthlyActiveUserReportResponse, *Errors, error) { - var resp MonthlyActiveUserReportResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/report/monthly-active-user"). - WithParameter("applicationId", applicationId). - WithParameter("start", strconv.FormatInt(start, 10)). - WithParameter("end", strconv.FormatInt(end, 10)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp MonthlyActiveUserReportResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/report/monthly-active-user"). + WithParameter("applicationId", applicationId). + WithParameter("start", strconv.FormatInt(start, 10)). + WithParameter("end", strconv.FormatInt(end, 10)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveOauthConfiguration // Retrieves the Oauth2 configuration for the application for the given Application Id. // string applicationId The Id of the Application to retrieve OAuth configuration. func (c *FusionAuthClient) RetrieveOauthConfiguration(applicationId string) (*OAuthConfigurationResponse, *Errors, error) { - var resp OAuthConfigurationResponse - var errors Errors + var resp OAuthConfigurationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithUriSegment("oauth-configuration"). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithUriSegment("oauth-configuration"). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveOpenIdConfiguration // Returns the well known OpenID Configuration JSON document func (c *FusionAuthClient) RetrieveOpenIdConfiguration() (*OpenIdConfiguration, error) { - var resp OpenIdConfiguration + var resp OpenIdConfiguration - err := c.StartAnonymous(&resp, nil). - WithUri("/.well-known/openid-configuration"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/.well-known/openid-configuration"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrievePasswordValidationRules -// Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided +// Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided // through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id. -// +// // This API does not require an API key. func (c *FusionAuthClient) RetrievePasswordValidationRules() (*PasswordValidationRulesResponse, error) { - var resp PasswordValidationRulesResponse + var resp PasswordValidationRulesResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/tenant/password-validation-rules"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/tenant/password-validation-rules"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrievePasswordValidationRulesWithTenantId // Retrieves the password validation rules for a specific tenant. -// +// // This API does not require an API key. // string tenantId The Id of the tenant. func (c *FusionAuthClient) RetrievePasswordValidationRulesWithTenantId(tenantId string) (*PasswordValidationRulesResponse, error) { - var resp PasswordValidationRulesResponse + var resp PasswordValidationRulesResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/tenant/password-validation-rules"). - WithUriSegment(tenantId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/tenant/password-validation-rules"). + WithUriSegment(tenantId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrievePendingChildren // Retrieves all of the children for the given parent email address. // string parentEmail The email of the parent. func (c *FusionAuthClient) RetrievePendingChildren(parentEmail string) (*PendingResponse, *Errors, error) { - var resp PendingResponse - var errors Errors + var resp PendingResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/family/pending"). - WithParameter("parentEmail", parentEmail). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/family/pending"). + WithParameter("parentEmail", parentEmail). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveRecentLogins @@ -2616,37 +2616,37 @@ func (c *FusionAuthClient) RetrievePendingChildren(parentEmail string) (*Pending // int offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login. // int limit (Optional, defaults to 10) The number of records to retrieve. func (c *FusionAuthClient) RetrieveRecentLogins(offset int, limit int) (*RecentLoginResponse, *Errors, error) { - var resp RecentLoginResponse - var errors Errors + var resp RecentLoginResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/recent-login"). - WithParameter("offset", strconv.Itoa(offset)). - WithParameter("limit", strconv.Itoa(limit)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/recent-login"). + WithParameter("offset", strconv.Itoa(offset)). + WithParameter("limit", strconv.Itoa(limit)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveRefreshTokens // Retrieves the refresh tokens that belong to the user with the given Id. // string userId The Id of the user. func (c *FusionAuthClient) RetrieveRefreshTokens(userId string) (*RefreshResponse, *Errors, error) { - var resp RefreshResponse - var errors Errors + var resp RefreshResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/jwt/refresh"). - WithParameter("userId", userId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/jwt/refresh"). + WithParameter("userId", userId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveRegistration @@ -2654,19 +2654,19 @@ func (c *FusionAuthClient) RetrieveRefreshTokens(userId string) (*RefreshRespons // string userId The Id of the user. // string applicationId The Id of the application. func (c *FusionAuthClient) RetrieveRegistration(userId string, applicationId string) (*RegistrationResponse, *Errors, error) { - var resp RegistrationResponse - var errors Errors + var resp RegistrationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/registration"). - WithUriSegment(userId). - WithUriSegment(applicationId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/registration"). + WithUriSegment(userId). + WithUriSegment(applicationId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveRegistrationReport @@ -2676,123 +2676,123 @@ func (c *FusionAuthClient) RetrieveRegistration(userId string, applicationId str // int64 start The start instant as UTC milliseconds since Epoch. // int64 end The end instant as UTC milliseconds since Epoch. func (c *FusionAuthClient) RetrieveRegistrationReport(applicationId string, start int64, end int64) (*RegistrationReportResponse, *Errors, error) { - var resp RegistrationReportResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/report/registration"). - WithParameter("applicationId", applicationId). - WithParameter("start", strconv.FormatInt(start, 10)). - WithParameter("end", strconv.FormatInt(end, 10)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp RegistrationReportResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/report/registration"). + WithParameter("applicationId", applicationId). + WithParameter("start", strconv.FormatInt(start, 10)). + WithParameter("end", strconv.FormatInt(end, 10)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveSystemConfiguration // Retrieves the system configuration. func (c *FusionAuthClient) RetrieveSystemConfiguration() (*SystemConfigurationResponse, error) { - var resp SystemConfigurationResponse + var resp SystemConfigurationResponse - err := c.Start(&resp, nil). - WithUri("/api/system-configuration"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/system-configuration"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveTenant // Retrieves the tenant for the given Id. // string tenantId The Id of the tenant. func (c *FusionAuthClient) RetrieveTenant(tenantId string) (*TenantResponse, *Errors, error) { - var resp TenantResponse - var errors Errors + var resp TenantResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/tenant"). - WithUriSegment(tenantId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant"). + WithUriSegment(tenantId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveTenants // Retrieves all of the tenants. func (c *FusionAuthClient) RetrieveTenants() (*TenantResponse, error) { - var resp TenantResponse + var resp TenantResponse - err := c.Start(&resp, nil). - WithUri("/api/tenant"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/tenant"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveTheme // Retrieves the theme for the given Id. // string themeId The Id of the theme. func (c *FusionAuthClient) RetrieveTheme(themeId string) (*ThemeResponse, *Errors, error) { - var resp ThemeResponse - var errors Errors + var resp ThemeResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/theme"). - WithUriSegment(themeId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/theme"). + WithUriSegment(themeId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveThemes // Retrieves all of the themes. func (c *FusionAuthClient) RetrieveThemes() (*ThemeResponse, error) { - var resp ThemeResponse + var resp ThemeResponse - err := c.Start(&resp, nil). - WithUri("/api/theme"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/theme"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveTotalReport // Retrieves the totals report. This contains all of the total counts for each application and the global registration // count. func (c *FusionAuthClient) RetrieveTotalReport() (*TotalsReportResponse, error) { - var resp TotalsReportResponse + var resp TotalsReportResponse - err := c.Start(&resp, nil). - WithUri("/api/report/totals"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/report/totals"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUser // Retrieves the user for the given Id. // string userId The Id of the user. func (c *FusionAuthClient) RetrieveUser(userId string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserAction @@ -2800,14 +2800,14 @@ func (c *FusionAuthClient) RetrieveUser(userId string) (*UserResponse, *Errors, // actions. // string userActionId (Optional) The Id of the user action. func (c *FusionAuthClient) RetrieveUserAction(userActionId string) (*UserActionResponse, error) { - var resp UserActionResponse + var resp UserActionResponse - err := c.Start(&resp, nil). - WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUserActionReason @@ -2815,38 +2815,38 @@ func (c *FusionAuthClient) RetrieveUserAction(userActionId string) (*UserActionR // action reasons. // string userActionReasonId (Optional) The Id of the user action reason. func (c *FusionAuthClient) RetrieveUserActionReason(userActionReasonId string) (*UserActionReasonResponse, error) { - var resp UserActionReasonResponse + var resp UserActionReasonResponse - err := c.Start(&resp, nil). - WithUri("/api/user-action-reason"). - WithUriSegment(userActionReasonId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user-action-reason"). + WithUriSegment(userActionReasonId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUserActionReasons // Retrieves all the user action reasons. func (c *FusionAuthClient) RetrieveUserActionReasons() (*UserActionReasonResponse, error) { - var resp UserActionReasonResponse + var resp UserActionReasonResponse - err := c.Start(&resp, nil). - WithUri("/api/user-action-reason"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user-action-reason"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUserActions // Retrieves all of the user actions. func (c *FusionAuthClient) RetrieveUserActions() (*UserActionResponse, error) { - var resp UserActionResponse + var resp UserActionResponse - err := c.Start(&resp, nil). - WithUri("/api/user-action"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user-action"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUserByChangePasswordId @@ -2854,72 +2854,72 @@ func (c *FusionAuthClient) RetrieveUserActions() (*UserActionResponse, error) { // password workflow has been initiated and you may not know the user's email or username. // string changePasswordId The unique change password Id that was sent via email or returned by the Forgot Password API. func (c *FusionAuthClient) RetrieveUserByChangePasswordId(changePasswordId string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithParameter("changePasswordId", changePasswordId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithParameter("changePasswordId", changePasswordId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserByEmail // Retrieves the user for the given email. // string email The email of the user. func (c *FusionAuthClient) RetrieveUserByEmail(email string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithParameter("email", email). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithParameter("email", email). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserByLoginId // Retrieves the user for the loginId. The loginId can be either the username or the email. // string loginId The email or username of the user. func (c *FusionAuthClient) RetrieveUserByLoginId(loginId string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithParameter("loginId", loginId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithParameter("loginId", loginId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserByUsername // Retrieves the user for the given username. // string username The username of the user. func (c *FusionAuthClient) RetrieveUserByUsername(username string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithParameter("username", username). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithParameter("username", username). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserByVerificationId @@ -2927,64 +2927,64 @@ func (c *FusionAuthClient) RetrieveUserByUsername(username string) (*UserRespons // password workflow has been initiated and you may not know the user's email or username. // string verificationId The unique verification Id that has been set on the user object. func (c *FusionAuthClient) RetrieveUserByVerificationId(verificationId string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithParameter("verificationId", verificationId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithParameter("verificationId", verificationId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserComments // Retrieves all of the comments for the user with the given Id. // string userId The Id of the user. func (c *FusionAuthClient) RetrieveUserComments(userId string) (*UserCommentResponse, *Errors, error) { - var resp UserCommentResponse - var errors Errors + var resp UserCommentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/comment"). - WithUriSegment(userId). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/comment"). + WithUriSegment(userId). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserConsent // Retrieve a single User consent by Id. // string userConsentId The User consent Id func (c *FusionAuthClient) RetrieveUserConsent(userConsentId string) (*UserConsentResponse, error) { - var resp UserConsentResponse + var resp UserConsentResponse - err := c.Start(&resp, nil). - WithUri("/api/user/consent"). - WithUriSegment(userConsentId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/consent"). + WithUriSegment(userConsentId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUserConsents // Retrieves all of the consents for a User. // string userId The User's Id func (c *FusionAuthClient) RetrieveUserConsents(userId string) (*UserConsentResponse, error) { - var resp UserConsentResponse + var resp UserConsentResponse - err := c.Start(&resp, nil). - WithUri("/api/user/consent"). - WithParameter("userId", userId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/consent"). + WithParameter("userId", userId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveUserLoginReport @@ -2995,21 +2995,21 @@ func (c *FusionAuthClient) RetrieveUserConsents(userId string) (*UserConsentResp // int64 start The start instant as UTC milliseconds since Epoch. // int64 end The end instant as UTC milliseconds since Epoch. func (c *FusionAuthClient) RetrieveUserLoginReport(applicationId string, userId string, start int64, end int64) (*LoginReportResponse, *Errors, error) { - var resp LoginReportResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/report/login"). - WithParameter("applicationId", applicationId). - WithParameter("userId", userId). - WithParameter("start", strconv.FormatInt(start, 10)). - WithParameter("end", strconv.FormatInt(end, 10)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp LoginReportResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/report/login"). + WithParameter("applicationId", applicationId). + WithParameter("userId", userId). + WithParameter("start", strconv.FormatInt(start, 10)). + WithParameter("end", strconv.FormatInt(end, 10)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserLoginReportByLoginId @@ -3020,21 +3020,21 @@ func (c *FusionAuthClient) RetrieveUserLoginReport(applicationId string, userId // int64 start The start instant as UTC milliseconds since Epoch. // int64 end The end instant as UTC milliseconds since Epoch. func (c *FusionAuthClient) RetrieveUserLoginReportByLoginId(applicationId string, loginId string, start int64, end int64) (*LoginReportResponse, *Errors, error) { - var resp LoginReportResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/report/login"). - WithParameter("applicationId", applicationId). - WithParameter("loginId", loginId). - WithParameter("start", strconv.FormatInt(start, 10)). - WithParameter("end", strconv.FormatInt(end, 10)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp LoginReportResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/report/login"). + WithParameter("applicationId", applicationId). + WithParameter("loginId", loginId). + WithParameter("start", strconv.FormatInt(start, 10)). + WithParameter("end", strconv.FormatInt(end, 10)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserRecentLogins @@ -3043,64 +3043,64 @@ func (c *FusionAuthClient) RetrieveUserLoginReportByLoginId(applicationId string // int offset The initial record. e.g. 0 is the last login, 100 will be the 100th most recent login. // int limit (Optional, defaults to 10) The number of records to retrieve. func (c *FusionAuthClient) RetrieveUserRecentLogins(userId string, offset int, limit int) (*RecentLoginResponse, *Errors, error) { - var resp RecentLoginResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/recent-login"). - WithParameter("userId", userId). - WithParameter("offset", strconv.Itoa(offset)). - WithParameter("limit", strconv.Itoa(limit)). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp RecentLoginResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/recent-login"). + WithParameter("userId", userId). + WithParameter("offset", strconv.Itoa(offset)). + WithParameter("limit", strconv.Itoa(limit)). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveUserUsingJWT // 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. // string encodedJWT The encoded JWT (access token). func (c *FusionAuthClient) RetrieveUserUsingJWT(encodedJWT string) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithAuthorization("JWT " + encodedJWT). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithAuthorization("JWT " + encodedJWT). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RetrieveWebhook // Retrieves the webhook for the given Id. If you pass in null for the id, this will return all the webhooks. // string webhookId (Optional) The Id of the webhook. func (c *FusionAuthClient) RetrieveWebhook(webhookId string) (*WebhookResponse, error) { - var resp WebhookResponse + var resp WebhookResponse - err := c.Start(&resp, nil). - WithUri("/api/webhook"). - WithUriSegment(webhookId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/webhook"). + WithUriSegment(webhookId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RetrieveWebhooks // Retrieves all the webhooks. func (c *FusionAuthClient) RetrieveWebhooks() (*WebhookResponse, error) { - var resp WebhookResponse + var resp WebhookResponse - err := c.Start(&resp, nil). - WithUri("/api/webhook"). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/webhook"). + WithMethod(http.MethodGet). + Do() + return &resp, err } // RevokeRefreshToken @@ -3110,94 +3110,94 @@ func (c *FusionAuthClient) RetrieveWebhooks() (*WebhookResponse, error) { // string userId (Optional) The user id whose tokens to delete. // string applicationId (Optional) The application id of the tokens to delete. func (c *FusionAuthClient) RevokeRefreshToken(token string, userId string, applicationId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/jwt/refresh"). - WithParameter("token", token). - WithParameter("userId", userId). - WithParameter("applicationId", applicationId). - WithMethod(http.MethodDelete). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp BaseHTTPResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/jwt/refresh"). + WithParameter("token", token). + WithParameter("userId", userId). + WithParameter("applicationId", applicationId). + WithMethod(http.MethodDelete). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // RevokeUserConsent // Revokes a single User consent by Id. // string userConsentId The User Consent Id func (c *FusionAuthClient) RevokeUserConsent(userConsentId string) (*BaseHTTPResponse, error) { - var resp BaseHTTPResponse + var resp BaseHTTPResponse - err := c.Start(&resp, nil). - WithUri("/api/user/consent"). - WithUriSegment(userConsentId). - WithMethod(http.MethodDelete). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/user/consent"). + WithUriSegment(userConsentId). + WithMethod(http.MethodDelete). + Do() + return &resp, err } // SearchAuditLogs // Searches the audit logs with the specified criteria and pagination. // AuditLogSearchRequest request The search criteria and pagination information. func (c *FusionAuthClient) SearchAuditLogs(request AuditLogSearchRequest) (*AuditLogSearchResponse, error) { - var resp AuditLogSearchResponse + var resp AuditLogSearchResponse - err := c.Start(&resp, nil). - WithUri("/api/system/audit-log/search"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/system/audit-log/search"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + return &resp, err } // SearchEventLogs // Searches the event logs with the specified criteria and pagination. // EventLogSearchRequest request The search criteria and pagination information. func (c *FusionAuthClient) SearchEventLogs(request EventLogSearchRequest) (*EventLogSearchResponse, error) { - var resp EventLogSearchResponse + var resp EventLogSearchResponse - err := c.Start(&resp, nil). - WithUri("/api/system/event-log/search"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/system/event-log/search"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + return &resp, err } // SearchLoginRecords // Searches the login records with the specified criteria and pagination. // LoginRecordSearchRequest request The search criteria and pagination information. func (c *FusionAuthClient) SearchLoginRecords(request LoginRecordSearchRequest) (*LoginRecordSearchResponse, error) { - var resp LoginRecordSearchResponse + var resp LoginRecordSearchResponse - err := c.Start(&resp, nil). - WithUri("/api/system/login-record/search"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - return &resp, err + err := c.Start(&resp, nil). + WithUri("/api/system/login-record/search"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + return &resp, err } // SearchUsers // Retrieves the users for the given ids. If any id is invalid, it is ignored. // []string ids The user ids to search for. func (c *FusionAuthClient) SearchUsers(ids []string) (*SearchResponse, *Errors, error) { - var resp SearchResponse - var errors Errors + var resp SearchResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/search"). - WithParameter("ids", ids). - WithMethod(http.MethodGet). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/search"). + WithParameter("ids", ids). + WithMethod(http.MethodGet). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // SearchUsersByQueryString @@ -3205,18 +3205,18 @@ func (c *FusionAuthClient) SearchUsers(ids []string) (*SearchResponse, *Errors, // SearchRequest request The search criteria and pagination constraints. Fields used: queryString, numberOfResults, startRow, // and sort fields. func (c *FusionAuthClient) SearchUsersByQueryString(request SearchRequest) (*SearchResponse, *Errors, error) { - var resp SearchResponse - var errors Errors + var resp SearchResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/search"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/search"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // SendEmail @@ -3225,91 +3225,91 @@ func (c *FusionAuthClient) SearchUsersByQueryString(request SearchRequest) (*Sea // string emailTemplateId The id for the template. // SendRequest request The send email request that contains all of the information used to send the email. func (c *FusionAuthClient) SendEmail(emailTemplateId string, request SendRequest) (*SendResponse, *Errors, error) { - var resp SendResponse - var errors Errors + var resp SendResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/email/send"). - WithUriSegment(emailTemplateId). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/email/send"). + WithUriSegment(emailTemplateId). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // SendFamilyRequestEmail // 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. // FamilyEmailRequest request The request object that contains the parent email. func (c *FusionAuthClient) SendFamilyRequestEmail(request FamilyEmailRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/family/request"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/family/request"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // SendPasswordlessCode // Send a passwordless authentication code in an email to complete login. // PasswordlessSendRequest request The passwordless send request that contains all of the information used to send an email containing a code. func (c *FusionAuthClient) SendPasswordlessCode(request PasswordlessSendRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/passwordless/send"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/passwordless/send"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // SendTwoFactorCode // Send a Two Factor authentication code to assist in setting up Two Factor authentication or disabling. // TwoFactorSendRequest request The request object that contains all of the information used to send the code. func (c *FusionAuthClient) SendTwoFactorCode(request TwoFactorSendRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/two-factor/send"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/two-factor/send"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // SendTwoFactorCodeForLogin // Send a Two Factor authentication code to allow the completion of Two Factor authentication. // string twoFactorId The Id returned by the Login API necessary to complete Two Factor authentication. func (c *FusionAuthClient) SendTwoFactorCodeForLogin(twoFactorId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/two-factor/send"). - WithUriSegment(twoFactorId). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/two-factor/send"). + WithUriSegment(twoFactorId). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // StartIdentityProviderLogin @@ -3317,18 +3317,18 @@ func (c *FusionAuthClient) SendTwoFactorCodeForLogin(twoFactorId string) (*BaseH // IdentityProviderStartLoginRequest request The third-party login request that contains information from the third-party login // providers that FusionAuth uses to reconcile the user's account. func (c *FusionAuthClient) StartIdentityProviderLogin(request IdentityProviderStartLoginRequest) (*IdentityProviderStartLoginResponse, *Errors, error) { - var resp IdentityProviderStartLoginResponse - var errors Errors + var resp IdentityProviderStartLoginResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/identity-provider/start"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/identity-provider/start"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // StartPasswordlessLogin @@ -3336,36 +3336,36 @@ func (c *FusionAuthClient) StartIdentityProviderLogin(request IdentityProviderSt // Passwordless Code API or using a mechanism outside of FusionAuth. The passwordless login is completed by using the Passwordless Login API with this code. // PasswordlessStartRequest request The passwordless start request that contains all of the information used to begin the passwordless login request. func (c *FusionAuthClient) StartPasswordlessLogin(request PasswordlessStartRequest) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/passwordless/start"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/passwordless/start"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // TwoFactorLogin // Complete login using a 2FA challenge // TwoFactorLoginRequest request The login request that contains the user credentials used to log them in. func (c *FusionAuthClient) TwoFactorLogin(request TwoFactorLoginRequest) (*LoginResponse, *Errors, error) { - var resp LoginResponse - var errors Errors + var resp LoginResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/two-factor/login"). - WithJSONBody(request). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/two-factor/login"). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateApplication @@ -3373,19 +3373,19 @@ func (c *FusionAuthClient) TwoFactorLogin(request TwoFactorLoginRequest) (*Login // string applicationId The Id of the application to update. // ApplicationRequest request The request that contains all of the new application information. func (c *FusionAuthClient) UpdateApplication(applicationId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors + var resp ApplicationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateApplicationRole @@ -3394,21 +3394,21 @@ func (c *FusionAuthClient) UpdateApplication(applicationId string, request Appli // string roleId The Id of the role to update. // ApplicationRequest request The request that contains all of the new role information. func (c *FusionAuthClient) UpdateApplicationRole(applicationId string, roleId string, request ApplicationRequest) (*ApplicationResponse, *Errors, error) { - var resp ApplicationResponse - var errors Errors - - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/application"). - WithUriSegment(applicationId). - WithUriSegment("role"). - WithUriSegment(roleId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp ApplicationResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/application"). + WithUriSegment(applicationId). + WithUriSegment("role"). + WithUriSegment(roleId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateConsent @@ -3416,19 +3416,19 @@ func (c *FusionAuthClient) UpdateApplicationRole(applicationId string, roleId st // string consentId The Id of the consent to update. // ConsentRequest request The request that contains all of the new consent information. func (c *FusionAuthClient) UpdateConsent(consentId string, request ConsentRequest) (*ConsentResponse, *Errors, error) { - var resp ConsentResponse - var errors Errors + var resp ConsentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/consent"). - WithUriSegment(consentId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/consent"). + WithUriSegment(consentId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateEmailTemplate @@ -3436,19 +3436,19 @@ func (c *FusionAuthClient) UpdateConsent(consentId string, request ConsentReques // string emailTemplateId The Id of the email template to update. // EmailTemplateRequest request The request that contains all of the new email template information. func (c *FusionAuthClient) UpdateEmailTemplate(emailTemplateId string, request EmailTemplateRequest) (*EmailTemplateResponse, *Errors, error) { - var resp EmailTemplateResponse - var errors Errors + var resp EmailTemplateResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/email/template"). - WithUriSegment(emailTemplateId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/email/template"). + WithUriSegment(emailTemplateId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateGroup @@ -3456,37 +3456,37 @@ func (c *FusionAuthClient) UpdateEmailTemplate(emailTemplateId string, request E // string groupId The Id of the group to update. // GroupRequest request The request that contains all of the new group information. func (c *FusionAuthClient) UpdateGroup(groupId string, request GroupRequest) (*GroupResponse, *Errors, error) { - var resp GroupResponse - var errors Errors + var resp GroupResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/group"). - WithUriSegment(groupId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/group"). + WithUriSegment(groupId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateIntegrations // Updates the available integrations. // IntegrationRequest request The request that contains all of the new integration information. func (c *FusionAuthClient) UpdateIntegrations(request IntegrationRequest) (*IntegrationResponse, *Errors, error) { - var resp IntegrationResponse - var errors Errors + var resp IntegrationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/integration"). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/integration"). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateKey @@ -3494,19 +3494,19 @@ func (c *FusionAuthClient) UpdateIntegrations(request IntegrationRequest) (*Inte // string keyId The Id of the key to update. // KeyRequest request The request that contains all of the new key information. func (c *FusionAuthClient) UpdateKey(keyId string, request KeyRequest) (*KeyResponse, *Errors, error) { - var resp KeyResponse - var errors Errors + var resp KeyResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/key"). - WithUriSegment(keyId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/key"). + WithUriSegment(keyId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateLambda @@ -3514,19 +3514,19 @@ func (c *FusionAuthClient) UpdateKey(keyId string, request KeyRequest) (*KeyResp // string lambdaId The Id of the lambda to update. // LambdaRequest request The request that contains all of the new lambda information. func (c *FusionAuthClient) UpdateLambda(lambdaId string, request LambdaRequest) (*LambdaResponse, *Errors, error) { - var resp LambdaResponse - var errors Errors + var resp LambdaResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/lambda"). - WithUriSegment(lambdaId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/lambda"). + WithUriSegment(lambdaId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateRegistration @@ -3534,37 +3534,37 @@ func (c *FusionAuthClient) UpdateLambda(lambdaId string, request LambdaRequest) // string userId The Id of the user whose registration is going to be updated. // RegistrationRequest request The request that contains all of the new registration information. func (c *FusionAuthClient) UpdateRegistration(userId string, request RegistrationRequest) (*RegistrationResponse, *Errors, error) { - var resp RegistrationResponse - var errors Errors + var resp RegistrationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/registration"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/registration"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateSystemConfiguration // Updates the system configuration. // SystemConfigurationRequest request The request that contains all of the new system configuration information. func (c *FusionAuthClient) UpdateSystemConfiguration(request SystemConfigurationRequest) (*SystemConfigurationResponse, *Errors, error) { - var resp SystemConfigurationResponse - var errors Errors + var resp SystemConfigurationResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/system-configuration"). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/system-configuration"). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateTenant @@ -3572,19 +3572,19 @@ func (c *FusionAuthClient) UpdateSystemConfiguration(request SystemConfiguration // string tenantId The Id of the tenant to update. // TenantRequest request The request that contains all of the new tenant information. func (c *FusionAuthClient) UpdateTenant(tenantId string, request TenantRequest) (*TenantResponse, *Errors, error) { - var resp TenantResponse - var errors Errors + var resp TenantResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/tenant"). - WithUriSegment(tenantId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant"). + WithUriSegment(tenantId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateTheme @@ -3592,19 +3592,19 @@ func (c *FusionAuthClient) UpdateTenant(tenantId string, request TenantRequest) // string themeId The Id of the theme to update. // ThemeRequest request The request that contains all of the new theme information. func (c *FusionAuthClient) UpdateTheme(themeId string, request ThemeRequest) (*ThemeResponse, *Errors, error) { - var resp ThemeResponse - var errors Errors + var resp ThemeResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/theme"). - WithUriSegment(themeId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/theme"). + WithUriSegment(themeId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateUser @@ -3612,19 +3612,19 @@ func (c *FusionAuthClient) UpdateTheme(themeId string, request ThemeRequest) (*T // string userId The Id of the user to update. // UserRequest request The request that contains all of the new user information. func (c *FusionAuthClient) UpdateUser(userId string, request UserRequest) (*UserResponse, *Errors, error) { - var resp UserResponse - var errors Errors + var resp UserResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user"). - WithUriSegment(userId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user"). + WithUriSegment(userId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateUserAction @@ -3632,19 +3632,19 @@ func (c *FusionAuthClient) UpdateUser(userId string, request UserRequest) (*User // string userActionId The Id of the user action to update. // UserActionRequest request The request that contains all of the new user action information. func (c *FusionAuthClient) UpdateUserAction(userActionId string, request UserActionRequest) (*UserActionResponse, *Errors, error) { - var resp UserActionResponse - var errors Errors + var resp UserActionResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action"). - WithUriSegment(userActionId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action"). + WithUriSegment(userActionId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateUserActionReason @@ -3652,19 +3652,19 @@ func (c *FusionAuthClient) UpdateUserAction(userActionId string, request UserAct // string userActionReasonId The Id of the user action reason to update. // UserActionReasonRequest request The request that contains all of the new user action reason information. func (c *FusionAuthClient) UpdateUserActionReason(userActionReasonId string, request UserActionReasonRequest) (*UserActionReasonResponse, *Errors, error) { - var resp UserActionReasonResponse - var errors Errors + var resp UserActionReasonResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user-action-reason"). - WithUriSegment(userActionReasonId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user-action-reason"). + WithUriSegment(userActionReasonId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateUserConsent @@ -3672,19 +3672,19 @@ func (c *FusionAuthClient) UpdateUserActionReason(userActionReasonId string, req // string userConsentId The User Consent Id // UserConsentRequest request The request that contains the user consent information. func (c *FusionAuthClient) UpdateUserConsent(userConsentId string, request UserConsentRequest) (*UserConsentResponse, *Errors, error) { - var resp UserConsentResponse - var errors Errors + var resp UserConsentResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/user/consent"). - WithUriSegment(userConsentId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/user/consent"). + WithUriSegment(userConsentId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // UpdateWebhook @@ -3692,19 +3692,19 @@ func (c *FusionAuthClient) UpdateUserConsent(userConsentId string, request UserC // string webhookId The Id of the webhook to update. // WebhookRequest request The request that contains all of the new webhook information. func (c *FusionAuthClient) UpdateWebhook(webhookId string, request WebhookRequest) (*WebhookResponse, *Errors, error) { - var resp WebhookResponse - var errors Errors + var resp WebhookResponse + var errors Errors - restClient := c.Start(&resp, &errors) - err := restClient.WithUri("/api/webhook"). - WithUriSegment(webhookId). - WithJSONBody(request). - WithMethod(http.MethodPut). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/webhook"). + WithUriSegment(webhookId). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // ValidateDevice @@ -3713,15 +3713,15 @@ func (c *FusionAuthClient) UpdateWebhook(webhookId string, request WebhookReques // string userCode The end-user verification code. // string clientId The client id. func (c *FusionAuthClient) ValidateDevice(userCode string, clientId string) (*BaseHTTPResponse, error) { - var resp BaseHTTPResponse + var resp BaseHTTPResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/oauth2/device/validate"). - WithParameter("user_code", userCode). - WithParameter("client_id", clientId). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/oauth2/device/validate"). + WithParameter("user_code", userCode). + WithParameter("client_id", clientId). + WithMethod(http.MethodGet). + Do() + return &resp, err } // ValidateJWT @@ -3731,49 +3731,48 @@ func (c *FusionAuthClient) ValidateDevice(userCode string, clientId string) (*Ba // This API may be used to verify the JWT as well as decode the encoded JWT into human readable identity claims. // string encodedJWT The encoded JWT (access token). func (c *FusionAuthClient) ValidateJWT(encodedJWT string) (*ValidateResponse, error) { - var resp ValidateResponse + var resp ValidateResponse - err := c.StartAnonymous(&resp, nil). - WithUri("/api/jwt/validate"). - WithAuthorization("JWT " + encodedJWT). - WithMethod(http.MethodGet). - Do() - return &resp, err + err := c.StartAnonymous(&resp, nil). + WithUri("/api/jwt/validate"). + WithAuthorization("JWT " + encodedJWT). + WithMethod(http.MethodGet). + Do() + return &resp, err } // VerifyEmail // Confirms a email verification. The Id given is usually from an email sent to the user. // string verificationId The email verification id sent to the user. func (c *FusionAuthClient) VerifyEmail(verificationId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors + var resp BaseHTTPResponse + var errors Errors - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user/verify-email"). - WithUriSegment(verificationId). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/user/verify-email"). + WithUriSegment(verificationId). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } // VerifyRegistration // Confirms an application registration. The Id given is usually from an email sent to the user. // string verificationId The registration verification Id sent to the user. func (c *FusionAuthClient) VerifyRegistration(verificationId string) (*BaseHTTPResponse, *Errors, error) { - var resp BaseHTTPResponse - var errors Errors - - restClient := c.StartAnonymous(&resp, &errors) - err := restClient.WithUri("/api/user/verify-registration"). - WithUriSegment(verificationId). - WithMethod(http.MethodPost). - Do() - if restClient.ErrorRef == nil { - return &resp, nil, err - } - return &resp, &errors, err + var resp BaseHTTPResponse + var errors Errors + + restClient := c.StartAnonymous(&resp, &errors) + err := restClient.WithUri("/api/user/verify-registration"). + WithUriSegment(verificationId). + WithMethod(http.MethodPost). + Do() + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err } - diff --git a/pkg/fusionauth/Domain.go b/pkg/fusionauth/Domain.go index 41cf895..44ebcc9 100644 --- a/pkg/fusionauth/Domain.go +++ b/pkg/fusionauth/Domain.go @@ -12,56 +12,56 @@ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. -*/ - + */ package fusionauth type StatusAble interface { - SetStatus(status int) + SetStatus(status int) } /** * Base Response which contains the HTTP status code * * @author Matthew Altman -*/ + */ type BaseHTTPResponse struct { - StatusCode int `json:"statusCode,omitempty"` + StatusCode int `json:"statusCode,omitempty"` } func (b *BaseHTTPResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type AccessToken struct { - BaseHTTPResponse - AccessToken string `json:"access_token,omitempty"` - ExpiresIn int `json:"expires_in,omitempty"` - IdToken string `json:"id_token,omitempty"` - RefreshToken string `json:"refresh_token,omitempty"` - Scope string `json:"scope,omitempty"` - TokenType TokenType `json:"token_type,omitempty"` - UserId string `json:"userId,omitempty"` + BaseHTTPResponse + AccessToken string `json:"access_token,omitempty"` + ExpiresIn int `json:"expires_in,omitempty"` + IdToken string `json:"id_token,omitempty"` + RefreshToken string `json:"refresh_token,omitempty"` + Scope string `json:"scope,omitempty"` + TokenType TokenType `json:"token_type,omitempty"` + UserId string `json:"userId,omitempty"` } + func (b *AccessToken) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type ActionData struct { - ActioneeUserId string `json:"actioneeUserId,omitempty"` - ActionerUserId string `json:"actionerUserId,omitempty"` - ApplicationIds []string `json:"applicationIds,omitempty"` - Comment string `json:"comment,omitempty"` - EmailUser bool `json:"emailUser,omitempty"` - Expiry int64 `json:"expiry,omitempty"` - NotifyUser bool `json:"notifyUser,omitempty"` - Option string `json:"option,omitempty"` - ReasonId string `json:"reasonId,omitempty"` - UserActionId string `json:"userActionId,omitempty"` + ActioneeUserId string `json:"actioneeUserId,omitempty"` + ActionerUserId string `json:"actionerUserId,omitempty"` + ApplicationIds []string `json:"applicationIds,omitempty"` + Comment string `json:"comment,omitempty"` + EmailUser bool `json:"emailUser,omitempty"` + Expiry int64 `json:"expiry,omitempty"` + NotifyUser bool `json:"notifyUser,omitempty"` + Option string `json:"option,omitempty"` + ReasonId string `json:"reasonId,omitempty"` + UserActionId string `json:"userActionId,omitempty"` } /** @@ -70,8 +70,8 @@ type ActionData struct { * @author Brian Pontarelli */ type ActionRequest struct { - Action ActionData `json:"action,omitempty"` - Broadcast bool `json:"broadcast,omitempty"` + Action ActionData `json:"action,omitempty"` + Broadcast bool `json:"broadcast,omitempty"` } /** @@ -80,12 +80,13 @@ type ActionRequest struct { * @author Brian Pontarelli */ type ActionResponse struct { - BaseHTTPResponse - Action UserActionLog `json:"action,omitempty"` - Actions []UserActionLog `json:"actions,omitempty"` + BaseHTTPResponse + Action UserActionLog `json:"action,omitempty"` + Actions []UserActionLog `json:"actions,omitempty"` } + func (b *ActionResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -94,41 +95,42 @@ func (b *ActionResponse) SetStatus(status int) { * @author Daniel DeGroff */ type Algorithm string + const ( - Algorithm_ES256 Algorithm = "ES256" - Algorithm_ES384 Algorithm = "ES384" - Algorithm_ES512 Algorithm = "ES512" - Algorithm_HS256 Algorithm = "HS256" - Algorithm_HS384 Algorithm = "HS384" - Algorithm_HS512 Algorithm = "HS512" - Algorithm_RS256 Algorithm = "RS256" - Algorithm_RS384 Algorithm = "RS384" - Algorithm_RS512 Algorithm = "RS512" - Algorithm_None Algorithm = "none" + Algorithm_ES256 Algorithm = "ES256" + Algorithm_ES384 Algorithm = "ES384" + Algorithm_ES512 Algorithm = "ES512" + Algorithm_HS256 Algorithm = "HS256" + Algorithm_HS384 Algorithm = "HS384" + Algorithm_HS512 Algorithm = "HS512" + Algorithm_RS256 Algorithm = "RS256" + Algorithm_RS384 Algorithm = "RS384" + Algorithm_RS512 Algorithm = "RS512" + Algorithm_None Algorithm = "none" ) /** * @author Seth Musselman */ type Application struct { - Active bool `json:"active,omitempty"` - AuthenticationTokenConfiguration AuthenticationTokenConfiguration `json:"authenticationTokenConfiguration,omitempty"` - CleanSpeakConfiguration CleanSpeakConfiguration `json:"cleanSpeakConfiguration,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - Id string `json:"id,omitempty"` - JwtConfiguration JWTConfiguration `json:"jwtConfiguration,omitempty"` - LambdaConfiguration LambdaConfiguration `json:"lambdaConfiguration,omitempty"` - LoginConfiguration LoginConfiguration `json:"loginConfiguration,omitempty"` - Name string `json:"name,omitempty"` - OauthConfiguration OAuth2Configuration `json:"oauthConfiguration,omitempty"` - PasswordlessConfiguration PasswordlessConfiguration `json:"passwordlessConfiguration,omitempty"` - RegistrationConfiguration RegistrationConfiguration `json:"registrationConfiguration,omitempty"` - RegistrationDeletePolicy ApplicationRegistrationDeletePolicy `json:"registrationDeletePolicy,omitempty"` - Roles []ApplicationRole `json:"roles,omitempty"` - Samlv2Configuration SAMLv2Configuration `json:"samlv2Configuration,omitempty"` - TenantId string `json:"tenantId,omitempty"` - VerificationEmailTemplateId string `json:"verificationEmailTemplateId,omitempty"` - VerifyRegistration bool `json:"verifyRegistration,omitempty"` + Active bool `json:"active,omitempty"` + AuthenticationTokenConfiguration AuthenticationTokenConfiguration `json:"authenticationTokenConfiguration,omitempty"` + CleanSpeakConfiguration CleanSpeakConfiguration `json:"cleanSpeakConfiguration,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + Id string `json:"id,omitempty"` + JwtConfiguration JWTConfiguration `json:"jwtConfiguration,omitempty"` + LambdaConfiguration LambdaConfiguration `json:"lambdaConfiguration,omitempty"` + LoginConfiguration LoginConfiguration `json:"loginConfiguration,omitempty"` + Name string `json:"name,omitempty"` + OauthConfiguration OAuth2Configuration `json:"oauthConfiguration,omitempty"` + PasswordlessConfiguration PasswordlessConfiguration `json:"passwordlessConfiguration,omitempty"` + RegistrationConfiguration RegistrationConfiguration `json:"registrationConfiguration,omitempty"` + RegistrationDeletePolicy ApplicationRegistrationDeletePolicy `json:"registrationDeletePolicy,omitempty"` + Roles []ApplicationRole `json:"roles,omitempty"` + Samlv2Configuration SAMLv2Configuration `json:"samlv2Configuration,omitempty"` + TenantId string `json:"tenantId,omitempty"` + VerificationEmailTemplateId string `json:"verificationEmailTemplateId,omitempty"` + VerifyRegistration bool `json:"verifyRegistration,omitempty"` } /** @@ -137,7 +139,7 @@ type Application struct { * @author Trevor Smith */ type ApplicationRegistrationDeletePolicy struct { - Unverified TimeBasedDeletePolicy `json:"unverified,omitempty"` + Unverified TimeBasedDeletePolicy `json:"unverified,omitempty"` } /** @@ -146,9 +148,9 @@ type ApplicationRegistrationDeletePolicy struct { * @author Brian Pontarelli */ type ApplicationRequest struct { - Application Application `json:"application,omitempty"` - Role ApplicationRole `json:"role,omitempty"` - WebhookIds []string `json:"webhookIds,omitempty"` + Application Application `json:"application,omitempty"` + Role ApplicationRole `json:"role,omitempty"` + WebhookIds []string `json:"webhookIds,omitempty"` } /** @@ -157,13 +159,14 @@ type ApplicationRequest struct { * @author Brian Pontarelli */ type ApplicationResponse struct { - BaseHTTPResponse - Application Application `json:"application,omitempty"` - Applications []Application `json:"applications,omitempty"` - Role ApplicationRole `json:"role,omitempty"` + BaseHTTPResponse + Application Application `json:"application,omitempty"` + Applications []Application `json:"applications,omitempty"` + Role ApplicationRole `json:"role,omitempty"` } + func (b *ApplicationResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -172,11 +175,11 @@ func (b *ApplicationResponse) SetStatus(status int) { * @author Seth Musselman */ type ApplicationRole struct { - Description string `json:"description,omitempty"` - Id string `json:"id,omitempty"` - IsDefault bool `json:"isDefault,omitempty"` - IsSuperRole bool `json:"isSuperRole,omitempty"` - Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + IsDefault bool `json:"isDefault,omitempty"` + IsSuperRole bool `json:"isSuperRole,omitempty"` + Name string `json:"name,omitempty"` } /** @@ -185,9 +188,9 @@ type ApplicationRole struct { * @author Brian Pontarelli */ type Attachment struct { - Attachment []byte `json:"attachment,omitempty"` - Mime string `json:"mime,omitempty"` - Name string `json:"name,omitempty"` + Attachment []byte `json:"attachment,omitempty"` + Mime string `json:"mime,omitempty"` + Name string `json:"name,omitempty"` } /** @@ -196,33 +199,33 @@ type Attachment struct { * @author Brian Pontarelli */ type AuditLog struct { - Data map[string]interface{} `json:"data,omitempty"` - Id int64 `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - InsertUser string `json:"insertUser,omitempty"` - Message string `json:"message,omitempty"` - NewValue interface{} `json:"newValue,omitempty"` - OldValue interface{} `json:"oldValue,omitempty"` - Reason string `json:"reason,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + Id int64 `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + InsertUser string `json:"insertUser,omitempty"` + Message string `json:"message,omitempty"` + NewValue interface{} `json:"newValue,omitempty"` + OldValue interface{} `json:"oldValue,omitempty"` + Reason string `json:"reason,omitempty"` } type AuditLogConfiguration struct { - Delete DeleteConfiguration `json:"delete,omitempty"` + Delete DeleteConfiguration `json:"delete,omitempty"` } /** * @author Daniel DeGroff */ type AuditLogExportRequest struct { - BaseExportRequest - Criteria AuditLogSearchCriteria `json:"criteria,omitempty"` + BaseExportRequest + Criteria AuditLogSearchCriteria `json:"criteria,omitempty"` } /** * @author Brian Pontarelli */ type AuditLogRequest struct { - AuditLog AuditLog `json:"auditLog,omitempty"` + AuditLog AuditLog `json:"auditLog,omitempty"` } /** @@ -231,29 +234,30 @@ type AuditLogRequest struct { * @author Brian Pontarelli */ type AuditLogResponse struct { - BaseHTTPResponse - AuditLog AuditLog `json:"auditLog,omitempty"` + BaseHTTPResponse + AuditLog AuditLog `json:"auditLog,omitempty"` } + func (b *AuditLogResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Brian Pontarelli */ type AuditLogSearchCriteria struct { - BaseSearchCriteria - End int64 `json:"end,omitempty"` - Message string `json:"message,omitempty"` - Start int64 `json:"start,omitempty"` - User string `json:"user,omitempty"` + BaseSearchCriteria + End int64 `json:"end,omitempty"` + Message string `json:"message,omitempty"` + Start int64 `json:"start,omitempty"` + User string `json:"user,omitempty"` } /** * @author Brian Pontarelli */ type AuditLogSearchRequest struct { - Search AuditLogSearchCriteria `json:"search,omitempty"` + Search AuditLogSearchCriteria `json:"search,omitempty"` } /** @@ -262,16 +266,17 @@ type AuditLogSearchRequest struct { * @author Brian Pontarelli */ type AuditLogSearchResponse struct { - BaseHTTPResponse - AuditLogs []AuditLog `json:"auditLogs,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + AuditLogs []AuditLog `json:"auditLogs,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *AuditLogSearchResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type AuthenticationTokenConfiguration struct { - Enableable + Enableable } /** @@ -280,77 +285,78 @@ type AuthenticationTokenConfiguration struct { * @author Brian Pontarelli */ type BaseEvent struct { - CreateInstant int64 `json:"createInstant,omitempty"` - Id string `json:"id,omitempty"` - TenantId string `json:"tenantId,omitempty"` + CreateInstant int64 `json:"createInstant,omitempty"` + Id string `json:"id,omitempty"` + TenantId string `json:"tenantId,omitempty"` } /** * @author Daniel DeGroff */ type BaseExportRequest struct { - DateTimeSecondsFormat string `json:"dateTimeSecondsFormat,omitempty"` - ZoneId string `json:"zoneId,omitempty"` + DateTimeSecondsFormat string `json:"dateTimeSecondsFormat,omitempty"` + ZoneId string `json:"zoneId,omitempty"` } // Do not require a setter for 'type', it is defined by the concrete class and is not mutable type BaseIdentityProvider struct { - Enableable - ApplicationConfiguration map[string]interface{} `json:"applicationConfiguration,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - Debug bool `json:"debug,omitempty"` - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Type IdentityProviderType `json:"type,omitempty"` + Enableable + ApplicationConfiguration map[string]interface{} `json:"applicationConfiguration,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + Debug bool `json:"debug,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Type IdentityProviderType `json:"type,omitempty"` } /** * @author Daniel DeGroff */ type BaseIdentityProviderApplicationConfiguration struct { - Enableable - CreateRegistration bool `json:"createRegistration,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` + Enableable + CreateRegistration bool `json:"createRegistration,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` } /** * @author Daniel DeGroff */ type BaseLoginRequest struct { - ApplicationId string `json:"applicationId,omitempty"` - IpAddress string `json:"ipAddress,omitempty"` - MetaData MetaData `json:"metaData,omitempty"` - NoJWT bool `json:"noJWT,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + IpAddress string `json:"ipAddress,omitempty"` + MetaData MetaData `json:"metaData,omitempty"` + NoJWT bool `json:"noJWT,omitempty"` } /** * @author Brian Pontarelli */ type BaseSearchCriteria struct { - NumberOfResults int `json:"numberOfResults,omitempty"` - OrderBy string `json:"orderBy,omitempty"` - StartRow int `json:"startRow,omitempty"` + NumberOfResults int `json:"numberOfResults,omitempty"` + OrderBy string `json:"orderBy,omitempty"` + StartRow int `json:"startRow,omitempty"` } type CanonicalizationMethod string + const ( - CanonicalizationMethod_Exclusive CanonicalizationMethod = "exclusive" - CanonicalizationMethod_ExclusiveWithComments CanonicalizationMethod = "exclusive_with_comments" - CanonicalizationMethod_Inclusive CanonicalizationMethod = "inclusive" - CanonicalizationMethod_InclusiveWithComments CanonicalizationMethod = "inclusive_with_comments" + CanonicalizationMethod_Exclusive CanonicalizationMethod = "exclusive" + CanonicalizationMethod_ExclusiveWithComments CanonicalizationMethod = "exclusive_with_comments" + CanonicalizationMethod_Inclusive CanonicalizationMethod = "inclusive" + CanonicalizationMethod_InclusiveWithComments CanonicalizationMethod = "inclusive_with_comments" ) type CertificateInformation struct { - Issuer string `json:"issuer,omitempty"` - Md5Fingerprint string `json:"md5Fingerprint,omitempty"` - SerialNumber string `json:"serialNumber,omitempty"` - Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` - Sha1Thumbprint string `json:"sha1Thumbprint,omitempty"` - Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"` - Sha256Thumbprint string `json:"sha256Thumbprint,omitempty"` - Subject string `json:"subject,omitempty"` - ValidFrom int64 `json:"validFrom,omitempty"` - ValidTo int64 `json:"validTo,omitempty"` + Issuer string `json:"issuer,omitempty"` + Md5Fingerprint string `json:"md5Fingerprint,omitempty"` + SerialNumber string `json:"serialNumber,omitempty"` + Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` + Sha1Thumbprint string `json:"sha1Thumbprint,omitempty"` + Sha256Fingerprint string `json:"sha256Fingerprint,omitempty"` + Sha256Thumbprint string `json:"sha256Thumbprint,omitempty"` + Subject string `json:"subject,omitempty"` + ValidFrom int64 `json:"validFrom,omitempty"` + ValidTo int64 `json:"validTo,omitempty"` } /** @@ -359,10 +365,10 @@ type CertificateInformation struct { * @author Brian Pontarelli */ type ChangePasswordRequest struct { - CurrentPassword string `json:"currentPassword,omitempty"` - LoginId string `json:"loginId,omitempty"` - Password string `json:"password,omitempty"` - RefreshToken string `json:"refreshToken,omitempty"` + CurrentPassword string `json:"currentPassword,omitempty"` + LoginId string `json:"loginId,omitempty"` + Password string `json:"password,omitempty"` + RefreshToken string `json:"refreshToken,omitempty"` } /** @@ -371,12 +377,13 @@ type ChangePasswordRequest struct { * @author Daniel DeGroff */ type ChangePasswordResponse struct { - BaseHTTPResponse - OneTimePassword string `json:"oneTimePassword,omitempty"` - State map[string]interface{} `json:"state,omitempty"` + BaseHTTPResponse + OneTimePassword string `json:"oneTimePassword,omitempty"` + State map[string]interface{} `json:"state,omitempty"` } + func (b *ChangePasswordResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -385,11 +392,11 @@ func (b *ChangePasswordResponse) SetStatus(status int) { * @author Brian Pontarelli */ type CleanSpeakConfiguration struct { - Enableable - ApiKey string `json:"apiKey,omitempty"` - ApplicationIds []string `json:"applicationIds,omitempty"` - Url string `json:"url,omitempty"` - UsernameModeration UsernameModeration `json:"usernameModeration,omitempty"` + Enableable + ApiKey string `json:"apiKey,omitempty"` + ApplicationIds []string `json:"applicationIds,omitempty"` + Url string `json:"url,omitempty"` + UsernameModeration UsernameModeration `json:"usernameModeration,omitempty"` } /** @@ -398,15 +405,15 @@ type CleanSpeakConfiguration struct { * @author Daniel DeGroff */ type Consent struct { - ConsentEmailTemplateId string `json:"consentEmailTemplateId,omitempty"` - CountryMinimumAgeForSelfConsent map[string]int `json:"countryMinimumAgeForSelfConsent,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - DefaultMinimumAgeForSelfConsent int `json:"defaultMinimumAgeForSelfConsent,omitempty"` - EmailPlus EmailPlus `json:"emailPlus,omitempty"` - Id string `json:"id,omitempty"` - MultipleValuesAllowed bool `json:"multipleValuesAllowed,omitempty"` - Name string `json:"name,omitempty"` - Values []string `json:"values,omitempty"` + ConsentEmailTemplateId string `json:"consentEmailTemplateId,omitempty"` + CountryMinimumAgeForSelfConsent map[string]int `json:"countryMinimumAgeForSelfConsent,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + DefaultMinimumAgeForSelfConsent int `json:"defaultMinimumAgeForSelfConsent,omitempty"` + EmailPlus EmailPlus `json:"emailPlus,omitempty"` + Id string `json:"id,omitempty"` + MultipleValuesAllowed bool `json:"multipleValuesAllowed,omitempty"` + Name string `json:"name,omitempty"` + Values []string `json:"values,omitempty"` } /** @@ -415,7 +422,7 @@ type Consent struct { * @author Daniel DeGroff */ type ConsentRequest struct { - Consent Consent `json:"consent,omitempty"` + Consent Consent `json:"consent,omitempty"` } /** @@ -424,12 +431,13 @@ type ConsentRequest struct { * @author Daniel DeGroff */ type ConsentResponse struct { - BaseHTTPResponse - Consent Consent `json:"consent,omitempty"` - Consents []Consent `json:"consents,omitempty"` + BaseHTTPResponse + Consent Consent `json:"consent,omitempty"` + Consents []Consent `json:"consents,omitempty"` } + func (b *ConsentResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -438,9 +446,10 @@ func (b *ConsentResponse) SetStatus(status int) { * @author Daniel DeGroff */ type ConsentStatus string + const ( - ConsentStatus_Active ConsentStatus = "Active" - ConsentStatus_Revoked ConsentStatus = "Revoked" + ConsentStatus_Active ConsentStatus = "Active" + ConsentStatus_Revoked ConsentStatus = "Revoked" ) /** @@ -449,28 +458,29 @@ const ( * @author Brian Pontarelli */ type ContentStatus string + const ( - ContentStatus_ACTIVE ContentStatus = "ACTIVE" - ContentStatus_PENDING ContentStatus = "PENDING" - ContentStatus_REJECTED ContentStatus = "REJECTED" + ContentStatus_ACTIVE ContentStatus = "ACTIVE" + ContentStatus_PENDING ContentStatus = "PENDING" + ContentStatus_REJECTED ContentStatus = "REJECTED" ) type CORSConfiguration struct { - Enableable - AllowCredentials bool `json:"allowCredentials,omitempty"` - AllowedHeaders []string `json:"allowedHeaders,omitempty"` - AllowedMethods []HTTPMethod `json:"allowedMethods,omitempty"` - AllowedOrigins []string `json:"allowedOrigins,omitempty"` - ExposedHeaders []string `json:"exposedHeaders,omitempty"` - PreflightMaxAgeInSeconds int `json:"preflightMaxAgeInSeconds,omitempty"` + Enableable + AllowCredentials bool `json:"allowCredentials,omitempty"` + AllowedHeaders []string `json:"allowedHeaders,omitempty"` + AllowedMethods []HTTPMethod `json:"allowedMethods,omitempty"` + AllowedOrigins []string `json:"allowedOrigins,omitempty"` + ExposedHeaders []string `json:"exposedHeaders,omitempty"` + PreflightMaxAgeInSeconds int `json:"preflightMaxAgeInSeconds,omitempty"` } /** * @author Brian Pontarelli */ type Count struct { - Count int `json:"count,omitempty"` - Interval int `json:"interval,omitempty"` + Count int `json:"count,omitempty"` + Interval int `json:"interval,omitempty"` } /** @@ -479,57 +489,60 @@ type Count struct { * @author Brian Pontarelli */ type DailyActiveUserReportResponse struct { - BaseHTTPResponse - DailyActiveUsers []Count `json:"dailyActiveUsers,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + DailyActiveUsers []Count `json:"dailyActiveUsers,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *DailyActiveUserReportResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type DeleteConfiguration struct { - Enableable - NumberOfDaysToRetain int `json:"numberOfDaysToRetain,omitempty"` + Enableable + NumberOfDaysToRetain int `json:"numberOfDaysToRetain,omitempty"` } /** * @author Daniel DeGroff */ type DeviceInfo struct { - Description string `json:"description,omitempty"` - LastAccessedAddress string `json:"lastAccessedAddress,omitempty"` - LastAccessedInstant int64 `json:"lastAccessedInstant,omitempty"` - Name string `json:"name,omitempty"` - Type DeviceType `json:"type,omitempty"` + Description string `json:"description,omitempty"` + LastAccessedAddress string `json:"lastAccessedAddress,omitempty"` + LastAccessedInstant int64 `json:"lastAccessedInstant,omitempty"` + Name string `json:"name,omitempty"` + Type DeviceType `json:"type,omitempty"` } /** * @author Trevor Smith */ type DeviceResponse struct { - BaseHTTPResponse - DeviceCode string `json:"device_code,omitempty"` - ExpiresIn int `json:"expires_in,omitempty"` - Interval int `json:"interval,omitempty"` - UserCode string `json:"user_code,omitempty"` - VerificationUri string `json:"verification_uri,omitempty"` - VerificationUriComplete string `json:"verification_uri_complete,omitempty"` + BaseHTTPResponse + DeviceCode string `json:"device_code,omitempty"` + ExpiresIn int `json:"expires_in,omitempty"` + Interval int `json:"interval,omitempty"` + UserCode string `json:"user_code,omitempty"` + VerificationUri string `json:"verification_uri,omitempty"` + VerificationUriComplete string `json:"verification_uri_complete,omitempty"` } + func (b *DeviceResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type DeviceType string + const ( - DeviceType_BROWSER DeviceType = "BROWSER" - DeviceType_DESKTOP DeviceType = "DESKTOP" - DeviceType_LAPTOP DeviceType = "LAPTOP" - DeviceType_MOBILE DeviceType = "MOBILE" - DeviceType_OTHER DeviceType = "OTHER" - DeviceType_SERVER DeviceType = "SERVER" - DeviceType_TABLET DeviceType = "TABLET" - DeviceType_TV DeviceType = "TV" - DeviceType_UNKNOWN DeviceType = "UNKNOWN" + DeviceType_BROWSER DeviceType = "BROWSER" + DeviceType_DESKTOP DeviceType = "DESKTOP" + DeviceType_LAPTOP DeviceType = "LAPTOP" + DeviceType_MOBILE DeviceType = "MOBILE" + DeviceType_OTHER DeviceType = "OTHER" + DeviceType_SERVER DeviceType = "SERVER" + DeviceType_TABLET DeviceType = "TABLET" + DeviceType_TV DeviceType = "TV" + DeviceType_UNKNOWN DeviceType = "UNKNOWN" ) /** @@ -538,9 +551,9 @@ const ( * @author Brian Pontarelli */ type DisplayableRawLogin struct { - RawLogin - ApplicationName string `json:"applicationName,omitempty"` - LoginId string `json:"loginId,omitempty"` + RawLogin + ApplicationName string `json:"applicationName,omitempty"` + LoginId string `json:"loginId,omitempty"` } /** @@ -555,15 +568,15 @@ type DomainBasedIdentityProvider struct { * @author Brian Pontarelli */ type Email struct { - Attachments []Attachment `json:"attachments,omitempty"` - Bcc []EmailAddress `json:"bcc,omitempty"` - Cc []EmailAddress `json:"cc,omitempty"` - From EmailAddress `json:"from,omitempty"` - Html string `json:"html,omitempty"` - ReplyTo EmailAddress `json:"replyTo,omitempty"` - Subject string `json:"subject,omitempty"` - Text string `json:"text,omitempty"` - To []EmailAddress `json:"to,omitempty"` + Attachments []Attachment `json:"attachments,omitempty"` + Bcc []EmailAddress `json:"bcc,omitempty"` + Cc []EmailAddress `json:"cc,omitempty"` + From EmailAddress `json:"from,omitempty"` + Html string `json:"html,omitempty"` + ReplyTo EmailAddress `json:"replyTo,omitempty"` + Subject string `json:"subject,omitempty"` + Text string `json:"text,omitempty"` + To []EmailAddress `json:"to,omitempty"` } /** @@ -572,40 +585,41 @@ type Email struct { * @author Brian Pontarelli */ type EmailAddress struct { - Address string `json:"address,omitempty"` - Display string `json:"display,omitempty"` + Address string `json:"address,omitempty"` + Display string `json:"display,omitempty"` } /** * @author Brian Pontarelli */ type EmailConfiguration struct { - ForgotPasswordEmailTemplateId string `json:"forgotPasswordEmailTemplateId,omitempty"` - Host string `json:"host,omitempty"` - Password string `json:"password,omitempty"` - PasswordlessEmailTemplateId string `json:"passwordlessEmailTemplateId,omitempty"` - Port int `json:"port,omitempty"` - Properties string `json:"properties,omitempty"` - Security EmailSecurityType `json:"security,omitempty"` - SetPasswordEmailTemplateId string `json:"setPasswordEmailTemplateId,omitempty"` - Username string `json:"username,omitempty"` - VerificationEmailTemplateId string `json:"verificationEmailTemplateId,omitempty"` - VerifyEmail bool `json:"verifyEmail,omitempty"` - VerifyEmailWhenChanged bool `json:"verifyEmailWhenChanged,omitempty"` + ForgotPasswordEmailTemplateId string `json:"forgotPasswordEmailTemplateId,omitempty"` + Host string `json:"host,omitempty"` + Password string `json:"password,omitempty"` + PasswordlessEmailTemplateId string `json:"passwordlessEmailTemplateId,omitempty"` + Port int `json:"port,omitempty"` + Properties string `json:"properties,omitempty"` + Security EmailSecurityType `json:"security,omitempty"` + SetPasswordEmailTemplateId string `json:"setPasswordEmailTemplateId,omitempty"` + Username string `json:"username,omitempty"` + VerificationEmailTemplateId string `json:"verificationEmailTemplateId,omitempty"` + VerifyEmail bool `json:"verifyEmail,omitempty"` + VerifyEmailWhenChanged bool `json:"verifyEmailWhenChanged,omitempty"` } type EmailPlus struct { - Enableable - EmailTemplateId string `json:"emailTemplateId,omitempty"` - MaximumTimeToSendEmailInHours int `json:"maximumTimeToSendEmailInHours,omitempty"` - MinimumTimeToSendEmailInHours int `json:"minimumTimeToSendEmailInHours,omitempty"` + Enableable + EmailTemplateId string `json:"emailTemplateId,omitempty"` + MaximumTimeToSendEmailInHours int `json:"maximumTimeToSendEmailInHours,omitempty"` + MinimumTimeToSendEmailInHours int `json:"minimumTimeToSendEmailInHours,omitempty"` } type EmailSecurityType string + const ( - EmailSecurityType_NONE EmailSecurityType = "NONE" - EmailSecurityType_SSL EmailSecurityType = "SSL" - EmailSecurityType_TLS EmailSecurityType = "TLS" + EmailSecurityType_NONE EmailSecurityType = "NONE" + EmailSecurityType_SSL EmailSecurityType = "SSL" + EmailSecurityType_TLS EmailSecurityType = "TLS" ) /** @@ -614,22 +628,22 @@ const ( * @author Brian Pontarelli */ type EmailTemplate struct { - DefaultFromName string `json:"defaultFromName,omitempty"` - DefaultHtmlTemplate string `json:"defaultHtmlTemplate,omitempty"` - DefaultSubject string `json:"defaultSubject,omitempty"` - DefaultTextTemplate string `json:"defaultTextTemplate,omitempty"` - FromEmail string `json:"fromEmail,omitempty"` - Id string `json:"id,omitempty"` - LocalizedFromNames map[string]string `json:"localizedFromNames,omitempty"` - LocalizedHtmlTemplates map[string]string `json:"localizedHtmlTemplates,omitempty"` - LocalizedSubjects map[string]string `json:"localizedSubjects,omitempty"` - LocalizedTextTemplates map[string]string `json:"localizedTextTemplates,omitempty"` - Name string `json:"name,omitempty"` + DefaultFromName string `json:"defaultFromName,omitempty"` + DefaultHtmlTemplate string `json:"defaultHtmlTemplate,omitempty"` + DefaultSubject string `json:"defaultSubject,omitempty"` + DefaultTextTemplate string `json:"defaultTextTemplate,omitempty"` + FromEmail string `json:"fromEmail,omitempty"` + Id string `json:"id,omitempty"` + LocalizedFromNames map[string]string `json:"localizedFromNames,omitempty"` + LocalizedHtmlTemplates map[string]string `json:"localizedHtmlTemplates,omitempty"` + LocalizedSubjects map[string]string `json:"localizedSubjects,omitempty"` + LocalizedTextTemplates map[string]string `json:"localizedTextTemplates,omitempty"` + Name string `json:"name,omitempty"` } type EmailTemplateErrors struct { - ParseErrors map[string]string `json:"parseErrors,omitempty"` - RenderErrors map[string]string `json:"renderErrors,omitempty"` + ParseErrors map[string]string `json:"parseErrors,omitempty"` + RenderErrors map[string]string `json:"renderErrors,omitempty"` } /** @@ -638,7 +652,7 @@ type EmailTemplateErrors struct { * @author Brian Pontarelli */ type EmailTemplateRequest struct { - EmailTemplate EmailTemplate `json:"emailTemplate,omitempty"` + EmailTemplate EmailTemplate `json:"emailTemplate,omitempty"` } /** @@ -647,12 +661,13 @@ type EmailTemplateRequest struct { * @author Brian Pontarelli */ type EmailTemplateResponse struct { - BaseHTTPResponse - EmailTemplate EmailTemplate `json:"emailTemplate,omitempty"` - EmailTemplates []EmailTemplate `json:"emailTemplates,omitempty"` + BaseHTTPResponse + EmailTemplate EmailTemplate `json:"emailTemplate,omitempty"` + EmailTemplates []EmailTemplate `json:"emailTemplates,omitempty"` } + func (b *EmailTemplateResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -661,7 +676,7 @@ func (b *EmailTemplateResponse) SetStatus(status int) { * @author Daniel DeGroff */ type Enableable struct { - Enabled bool `json:"enabled,omitempty"` + Enabled bool `json:"enabled,omitempty"` } /** @@ -670,8 +685,8 @@ type Enableable struct { * @author Brian Pontarelli */ type Error struct { - Code string `json:"code,omitempty"` - Message string `json:"message,omitempty"` + Code string `json:"code,omitempty"` + Message string `json:"message,omitempty"` } /** @@ -680,20 +695,20 @@ type Error struct { * @author Brian Pontarelli */ type Errors struct { - FieldErrors map[string][]Error `json:"fieldErrors,omitempty"` - GeneralErrors []Error `json:"generalErrors,omitempty"` + FieldErrors map[string][]Error `json:"fieldErrors,omitempty"` + GeneralErrors []Error `json:"generalErrors,omitempty"` } /** * @author Brian Pontarelli */ type EventConfiguration struct { - Events map[EventType]EventConfigurationData `json:"events,omitempty"` + Events map[EventType]EventConfigurationData `json:"events,omitempty"` } type EventConfigurationData struct { - Enableable - TransactionType TransactionType `json:"transactionType,omitempty"` + Enableable + TransactionType TransactionType `json:"transactionType,omitempty"` } /** @@ -702,14 +717,14 @@ type EventConfigurationData struct { * @author Brian Pontarelli */ type EventLog struct { - Id int64 `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - Message string `json:"message,omitempty"` - Type EventLogType `json:"type,omitempty"` + Id int64 `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + Message string `json:"message,omitempty"` + Type EventLogType `json:"type,omitempty"` } type EventLogConfiguration struct { - NumberToRetain int `json:"numberToRetain,omitempty"` + NumberToRetain int `json:"numberToRetain,omitempty"` } /** @@ -718,11 +733,12 @@ type EventLogConfiguration struct { * @author Daniel DeGroff */ type EventLogResponse struct { - BaseHTTPResponse - EventLog EventLog `json:"eventLog,omitempty"` + BaseHTTPResponse + EventLog EventLog `json:"eventLog,omitempty"` } + func (b *EventLogResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -731,18 +747,18 @@ func (b *EventLogResponse) SetStatus(status int) { * @author Brian Pontarelli */ type EventLogSearchCriteria struct { - BaseSearchCriteria - End int64 `json:"end,omitempty"` - Message string `json:"message,omitempty"` - Start int64 `json:"start,omitempty"` - Type EventLogType `json:"type,omitempty"` + BaseSearchCriteria + End int64 `json:"end,omitempty"` + Message string `json:"message,omitempty"` + Start int64 `json:"start,omitempty"` + Type EventLogType `json:"type,omitempty"` } /** * @author Brian Pontarelli */ type EventLogSearchRequest struct { - Search EventLogSearchCriteria `json:"search,omitempty"` + Search EventLogSearchCriteria `json:"search,omitempty"` } /** @@ -751,12 +767,13 @@ type EventLogSearchRequest struct { * @author Brian Pontarelli */ type EventLogSearchResponse struct { - BaseHTTPResponse - EventLogs []EventLog `json:"eventLogs,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + EventLogs []EventLog `json:"eventLogs,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *EventLogSearchResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -765,10 +782,11 @@ func (b *EventLogSearchResponse) SetStatus(status int) { * @author Daniel DeGroff */ type EventLogType string + const ( - EventLogType_Information EventLogType = "Information" - EventLogType_Debug EventLogType = "Debug" - EventLogType_Error EventLogType = "Error" + EventLogType_Information EventLogType = "Information" + EventLogType_Debug EventLogType = "Debug" + EventLogType_Error EventLogType = "Error" ) /** @@ -777,7 +795,7 @@ const ( * @author Brian Pontarelli */ type EventRequest struct { - Event BaseEvent `json:"event,omitempty"` + Event BaseEvent `json:"event,omitempty"` } /** @@ -786,67 +804,69 @@ type EventRequest struct { * @author Brian Pontarelli */ type EventType string + const ( - EventType_UserDelete EventType = "UserDelete" - EventType_UserCreate EventType = "UserCreate" - EventType_UserUpdate EventType = "UserUpdate" - EventType_UserDeactivate EventType = "UserDeactivate" - EventType_UserBulkCreate EventType = "UserBulkCreate" - EventType_UserReactivate EventType = "UserReactivate" - EventType_UserAction EventType = "UserAction" - EventType_JWTRefreshTokenRevoke EventType = "JWTRefreshTokenRevoke" - EventType_JWTPublicKeyUpdate EventType = "JWTPublicKeyUpdate" - EventType_UserLoginSuccess EventType = "UserLoginSuccess" - EventType_UserLoginFailed EventType = "UserLoginFailed" - EventType_UserRegistrationCreate EventType = "UserRegistrationCreate" - EventType_UserRegistrationUpdate EventType = "UserRegistrationUpdate" - EventType_UserRegistrationDelete EventType = "UserRegistrationDelete" - EventType_UserRegistrationVerified EventType = "UserRegistrationVerified" - EventType_UserEmailVerified EventType = "UserEmailVerified" - EventType_Test EventType = "Test" + EventType_UserDelete EventType = "UserDelete" + EventType_UserCreate EventType = "UserCreate" + EventType_UserUpdate EventType = "UserUpdate" + EventType_UserDeactivate EventType = "UserDeactivate" + EventType_UserBulkCreate EventType = "UserBulkCreate" + EventType_UserReactivate EventType = "UserReactivate" + EventType_UserAction EventType = "UserAction" + EventType_JWTRefreshTokenRevoke EventType = "JWTRefreshTokenRevoke" + EventType_JWTPublicKeyUpdate EventType = "JWTPublicKeyUpdate" + EventType_UserLoginSuccess EventType = "UserLoginSuccess" + EventType_UserLoginFailed EventType = "UserLoginFailed" + EventType_UserRegistrationCreate EventType = "UserRegistrationCreate" + EventType_UserRegistrationUpdate EventType = "UserRegistrationUpdate" + EventType_UserRegistrationDelete EventType = "UserRegistrationDelete" + EventType_UserRegistrationVerified EventType = "UserRegistrationVerified" + EventType_UserEmailVerified EventType = "UserEmailVerified" + EventType_Test EventType = "Test" ) /** * @author Brian Pontarelli */ type ExpiryUnit string + const ( - ExpiryUnit_MINUTES ExpiryUnit = "MINUTES" - ExpiryUnit_HOURS ExpiryUnit = "HOURS" - ExpiryUnit_DAYS ExpiryUnit = "DAYS" - ExpiryUnit_WEEKS ExpiryUnit = "WEEKS" - ExpiryUnit_MONTHS ExpiryUnit = "MONTHS" - ExpiryUnit_YEARS ExpiryUnit = "YEARS" + ExpiryUnit_MINUTES ExpiryUnit = "MINUTES" + ExpiryUnit_HOURS ExpiryUnit = "HOURS" + ExpiryUnit_DAYS ExpiryUnit = "DAYS" + ExpiryUnit_WEEKS ExpiryUnit = "WEEKS" + ExpiryUnit_MONTHS ExpiryUnit = "MONTHS" + ExpiryUnit_YEARS ExpiryUnit = "YEARS" ) /** * @author Daniel DeGroff */ type ExternalIdentifierConfiguration struct { - AuthorizationGrantIdTimeToLiveInSeconds int `json:"authorizationGrantIdTimeToLiveInSeconds,omitempty"` - ChangePasswordIdGenerator SecureGeneratorConfiguration `json:"changePasswordIdGenerator,omitempty"` - ChangePasswordIdTimeToLiveInSeconds int `json:"changePasswordIdTimeToLiveInSeconds,omitempty"` - DeviceCodeTimeToLiveInSeconds int `json:"deviceCodeTimeToLiveInSeconds,omitempty"` - DeviceUserCodeIdGenerator SecureGeneratorConfiguration `json:"deviceUserCodeIdGenerator,omitempty"` - EmailVerificationIdGenerator SecureGeneratorConfiguration `json:"emailVerificationIdGenerator,omitempty"` - EmailVerificationIdTimeToLiveInSeconds int `json:"emailVerificationIdTimeToLiveInSeconds,omitempty"` - ExternalAuthenticationIdTimeToLiveInSeconds int `json:"externalAuthenticationIdTimeToLiveInSeconds,omitempty"` - OneTimePasswordTimeToLiveInSeconds int `json:"oneTimePasswordTimeToLiveInSeconds,omitempty"` - PasswordlessLoginGenerator SecureGeneratorConfiguration `json:"passwordlessLoginGenerator,omitempty"` - PasswordlessLoginTimeToLiveInSeconds int `json:"passwordlessLoginTimeToLiveInSeconds,omitempty"` - RegistrationVerificationIdGenerator SecureGeneratorConfiguration `json:"registrationVerificationIdGenerator,omitempty"` - RegistrationVerificationIdTimeToLiveInSeconds int `json:"registrationVerificationIdTimeToLiveInSeconds,omitempty"` - SetupPasswordIdGenerator SecureGeneratorConfiguration `json:"setupPasswordIdGenerator,omitempty"` - SetupPasswordIdTimeToLiveInSeconds int `json:"setupPasswordIdTimeToLiveInSeconds,omitempty"` - TwoFactorIdTimeToLiveInSeconds int `json:"twoFactorIdTimeToLiveInSeconds,omitempty"` - TwoFactorTrustIdTimeToLiveInSeconds int `json:"twoFactorTrustIdTimeToLiveInSeconds,omitempty"` + AuthorizationGrantIdTimeToLiveInSeconds int `json:"authorizationGrantIdTimeToLiveInSeconds,omitempty"` + ChangePasswordIdGenerator SecureGeneratorConfiguration `json:"changePasswordIdGenerator,omitempty"` + ChangePasswordIdTimeToLiveInSeconds int `json:"changePasswordIdTimeToLiveInSeconds,omitempty"` + DeviceCodeTimeToLiveInSeconds int `json:"deviceCodeTimeToLiveInSeconds,omitempty"` + DeviceUserCodeIdGenerator SecureGeneratorConfiguration `json:"deviceUserCodeIdGenerator,omitempty"` + EmailVerificationIdGenerator SecureGeneratorConfiguration `json:"emailVerificationIdGenerator,omitempty"` + EmailVerificationIdTimeToLiveInSeconds int `json:"emailVerificationIdTimeToLiveInSeconds,omitempty"` + ExternalAuthenticationIdTimeToLiveInSeconds int `json:"externalAuthenticationIdTimeToLiveInSeconds,omitempty"` + OneTimePasswordTimeToLiveInSeconds int `json:"oneTimePasswordTimeToLiveInSeconds,omitempty"` + PasswordlessLoginGenerator SecureGeneratorConfiguration `json:"passwordlessLoginGenerator,omitempty"` + PasswordlessLoginTimeToLiveInSeconds int `json:"passwordlessLoginTimeToLiveInSeconds,omitempty"` + RegistrationVerificationIdGenerator SecureGeneratorConfiguration `json:"registrationVerificationIdGenerator,omitempty"` + RegistrationVerificationIdTimeToLiveInSeconds int `json:"registrationVerificationIdTimeToLiveInSeconds,omitempty"` + SetupPasswordIdGenerator SecureGeneratorConfiguration `json:"setupPasswordIdGenerator,omitempty"` + SetupPasswordIdTimeToLiveInSeconds int `json:"setupPasswordIdTimeToLiveInSeconds,omitempty"` + TwoFactorIdTimeToLiveInSeconds int `json:"twoFactorIdTimeToLiveInSeconds,omitempty"` + TwoFactorTrustIdTimeToLiveInSeconds int `json:"twoFactorTrustIdTimeToLiveInSeconds,omitempty"` } /** * @author Daniel DeGroff */ type ExternalJWTApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration + BaseIdentityProviderApplicationConfiguration } /** @@ -855,25 +875,25 @@ type ExternalJWTApplicationConfiguration struct { * @author Daniel DeGroff and Brian Pontarelli */ type ExternalJWTIdentityProvider struct { - BaseIdentityProvider - ClaimMap map[string]string `json:"claimMap,omitempty"` - Domains []string `json:"domains,omitempty"` - HeaderKeyParameter string `json:"headerKeyParameter,omitempty"` - Keys map[string]string `json:"keys,omitempty"` - Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` - UniqueIdentityClaim string `json:"uniqueIdentityClaim,omitempty"` + BaseIdentityProvider + ClaimMap map[string]string `json:"claimMap,omitempty"` + Domains []string `json:"domains,omitempty"` + HeaderKeyParameter string `json:"headerKeyParameter,omitempty"` + Keys map[string]string `json:"keys,omitempty"` + Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` + UniqueIdentityClaim string `json:"uniqueIdentityClaim,omitempty"` } /** * @author Daniel DeGroff */ type FacebookApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration - AppId string `json:"appId,omitempty"` - ButtonText string `json:"buttonText,omitempty"` - ClientSecret string `json:"client_secret,omitempty"` - Fields string `json:"fields,omitempty"` - Permissions string `json:"permissions,omitempty"` + BaseIdentityProviderApplicationConfiguration + AppId string `json:"appId,omitempty"` + ButtonText string `json:"buttonText,omitempty"` + ClientSecret string `json:"client_secret,omitempty"` + Fields string `json:"fields,omitempty"` + Permissions string `json:"permissions,omitempty"` } /** @@ -882,12 +902,12 @@ type FacebookApplicationConfiguration struct { * @author Brian Pontarelli */ type FacebookIdentityProvider struct { - BaseIdentityProvider - AppId string `json:"appId,omitempty"` - ButtonText string `json:"buttonText,omitempty"` - ClientSecret string `json:"client_secret,omitempty"` - Fields string `json:"fields,omitempty"` - Permissions string `json:"permissions,omitempty"` + BaseIdentityProvider + AppId string `json:"appId,omitempty"` + ButtonText string `json:"buttonText,omitempty"` + ClientSecret string `json:"client_secret,omitempty"` + Fields string `json:"fields,omitempty"` + Permissions string `json:"permissions,omitempty"` } /** @@ -896,11 +916,11 @@ type FacebookIdentityProvider struct { * @author Daniel DeGroff */ type FailedAuthenticationConfiguration struct { - ActionDuration int64 `json:"actionDuration,omitempty"` - ActionDurationUnit ExpiryUnit `json:"actionDurationUnit,omitempty"` - ResetCountInSeconds int `json:"resetCountInSeconds,omitempty"` - TooManyAttempts int `json:"tooManyAttempts,omitempty"` - UserActionId string `json:"userActionId,omitempty"` + ActionDuration int64 `json:"actionDuration,omitempty"` + ActionDurationUnit ExpiryUnit `json:"actionDurationUnit,omitempty"` + ResetCountInSeconds int `json:"resetCountInSeconds,omitempty"` + TooManyAttempts int `json:"tooManyAttempts,omitempty"` + UserActionId string `json:"userActionId,omitempty"` } /** @@ -909,24 +929,24 @@ type FailedAuthenticationConfiguration struct { * @author Brian Pontarelli */ type Family struct { - Id string `json:"id,omitempty"` - Members []FamilyMember `json:"members,omitempty"` + Id string `json:"id,omitempty"` + Members []FamilyMember `json:"members,omitempty"` } /** * @author Brian Pontarelli */ type FamilyConfiguration struct { - Enableable - AllowChildRegistrations bool `json:"allowChildRegistrations,omitempty"` - ConfirmChildEmailTemplateId string `json:"confirmChildEmailTemplateId,omitempty"` - DeleteOrphanedAccounts bool `json:"deleteOrphanedAccounts,omitempty"` - DeleteOrphanedAccountsDays int `json:"deleteOrphanedAccountsDays,omitempty"` - FamilyRequestEmailTemplateId string `json:"familyRequestEmailTemplateId,omitempty"` - MaximumChildAge int `json:"maximumChildAge,omitempty"` - MinimumOwnerAge int `json:"minimumOwnerAge,omitempty"` - ParentEmailRequired bool `json:"parentEmailRequired,omitempty"` - ParentRegistrationEmailTemplateId string `json:"parentRegistrationEmailTemplateId,omitempty"` + Enableable + AllowChildRegistrations bool `json:"allowChildRegistrations,omitempty"` + ConfirmChildEmailTemplateId string `json:"confirmChildEmailTemplateId,omitempty"` + DeleteOrphanedAccounts bool `json:"deleteOrphanedAccounts,omitempty"` + DeleteOrphanedAccountsDays int `json:"deleteOrphanedAccountsDays,omitempty"` + FamilyRequestEmailTemplateId string `json:"familyRequestEmailTemplateId,omitempty"` + MaximumChildAge int `json:"maximumChildAge,omitempty"` + MinimumOwnerAge int `json:"minimumOwnerAge,omitempty"` + ParentEmailRequired bool `json:"parentEmailRequired,omitempty"` + ParentRegistrationEmailTemplateId string `json:"parentRegistrationEmailTemplateId,omitempty"` } /** @@ -935,7 +955,7 @@ type FamilyConfiguration struct { * @author Brian Pontarelli */ type FamilyEmailRequest struct { - ParentEmail string `json:"parentEmail,omitempty"` + ParentEmail string `json:"parentEmail,omitempty"` } /** @@ -944,11 +964,11 @@ type FamilyEmailRequest struct { * @author Brian Pontarelli */ type FamilyMember struct { - Data map[string]interface{} `json:"data,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - Owner bool `json:"owner,omitempty"` - Role FamilyRole `json:"role,omitempty"` - UserId string `json:"userId,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + Owner bool `json:"owner,omitempty"` + Role FamilyRole `json:"role,omitempty"` + UserId string `json:"userId,omitempty"` } /** @@ -957,7 +977,7 @@ type FamilyMember struct { * @author Brian Pontarelli */ type FamilyRequest struct { - FamilyMember FamilyMember `json:"familyMember,omitempty"` + FamilyMember FamilyMember `json:"familyMember,omitempty"` } /** @@ -966,19 +986,21 @@ type FamilyRequest struct { * @author Brian Pontarelli */ type FamilyResponse struct { - BaseHTTPResponse - Families []Family `json:"families,omitempty"` - Family Family `json:"family,omitempty"` + BaseHTTPResponse + Families []Family `json:"families,omitempty"` + Family Family `json:"family,omitempty"` } + func (b *FamilyResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type FamilyRole string + const ( - FamilyRole_Child FamilyRole = "Child" - FamilyRole_Teen FamilyRole = "Teen" - FamilyRole_Adult FamilyRole = "Adult" + FamilyRole_Child FamilyRole = "Child" + FamilyRole_Teen FamilyRole = "Teen" + FamilyRole_Adult FamilyRole = "Adult" ) /** @@ -987,12 +1009,12 @@ const ( * @author Brian Pontarelli */ type ForgotPasswordRequest struct { - ChangePasswordId string `json:"changePasswordId,omitempty"` - Email string `json:"email,omitempty"` - LoginId string `json:"loginId,omitempty"` - SendForgotPasswordEmail bool `json:"sendForgotPasswordEmail,omitempty"` - State map[string]interface{} `json:"state,omitempty"` - Username string `json:"username,omitempty"` + ChangePasswordId string `json:"changePasswordId,omitempty"` + Email string `json:"email,omitempty"` + LoginId string `json:"loginId,omitempty"` + SendForgotPasswordEmail bool `json:"sendForgotPasswordEmail,omitempty"` + State map[string]interface{} `json:"state,omitempty"` + Username string `json:"username,omitempty"` } /** @@ -1001,22 +1023,23 @@ type ForgotPasswordRequest struct { * @author Daniel DeGroff */ type ForgotPasswordResponse struct { - BaseHTTPResponse - ChangePasswordId string `json:"changePasswordId,omitempty"` + BaseHTTPResponse + ChangePasswordId string `json:"changePasswordId,omitempty"` } + func (b *ForgotPasswordResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type GoogleApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration - ButtonText string `json:"buttonText,omitempty"` - ClientId string `json:"client_id,omitempty"` - ClientSecret string `json:"client_secret,omitempty"` - Scope string `json:"scope,omitempty"` + BaseIdentityProviderApplicationConfiguration + ButtonText string `json:"buttonText,omitempty"` + ClientId string `json:"client_id,omitempty"` + ClientSecret string `json:"client_secret,omitempty"` + Scope string `json:"scope,omitempty"` } /** @@ -1025,11 +1048,11 @@ type GoogleApplicationConfiguration struct { * @author Daniel DeGroff */ type GoogleIdentityProvider struct { - BaseIdentityProvider - ButtonText string `json:"buttonText,omitempty"` - ClientId string `json:"client_id,omitempty"` - ClientSecret string `json:"client_secret,omitempty"` - Scope string `json:"scope,omitempty"` + BaseIdentityProvider + ButtonText string `json:"buttonText,omitempty"` + ClientId string `json:"client_id,omitempty"` + ClientSecret string `json:"client_secret,omitempty"` + Scope string `json:"scope,omitempty"` } /** @@ -1042,25 +1065,26 @@ type GoogleIdentityProvider struct { * @author Daniel DeGroff */ type GrantType string + const ( - GrantType_AuthorizationCode GrantType = "authorization_code" - GrantType_Implicit GrantType = "implicit" - GrantType_Password GrantType = "password" - GrantType_ClientCredentials GrantType = "client_credentials" - GrantType_RefreshToken GrantType = "refresh_token" - GrantType_Unknown GrantType = "unknown" - GrantType_DeviceCode GrantType = "device_code" + GrantType_AuthorizationCode GrantType = "authorization_code" + GrantType_Implicit GrantType = "implicit" + GrantType_Password GrantType = "password" + GrantType_ClientCredentials GrantType = "client_credentials" + GrantType_RefreshToken GrantType = "refresh_token" + GrantType_Unknown GrantType = "unknown" + GrantType_DeviceCode GrantType = "device_code" ) /** * @author Tyler Scott */ type Group struct { - Data map[string]interface{} `json:"data,omitempty"` - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Roles map[string][]ApplicationRole `json:"roles,omitempty"` - TenantId string `json:"tenantId,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Roles map[string][]ApplicationRole `json:"roles,omitempty"` + TenantId string `json:"tenantId,omitempty"` } /** @@ -1069,11 +1093,11 @@ type Group struct { * @author Daniel DeGroff */ type GroupMember struct { - Data map[string]interface{} `json:"data,omitempty"` - GroupId string `json:"groupId,omitempty"` - Id string `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - UserId string `json:"userId,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + GroupId string `json:"groupId,omitempty"` + Id string `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + UserId string `json:"userId,omitempty"` } /** @@ -1082,8 +1106,8 @@ type GroupMember struct { * @author Daniel DeGroff */ type GroupRequest struct { - Group Group `json:"group,omitempty"` - RoleIds []string `json:"roleIds,omitempty"` + Group Group `json:"group,omitempty"` + RoleIds []string `json:"roleIds,omitempty"` } /** @@ -1092,59 +1116,61 @@ type GroupRequest struct { * @author Daniel DeGroff */ type GroupResponse struct { - BaseHTTPResponse - Group Group `json:"group,omitempty"` - Groups []Group `json:"groups,omitempty"` + BaseHTTPResponse + Group Group `json:"group,omitempty"` + Groups []Group `json:"groups,omitempty"` } + func (b *GroupResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type HistoryItem struct { - ActionerUserId string `json:"actionerUserId,omitempty"` - Comment string `json:"comment,omitempty"` - CreateInstant int64 `json:"createInstant,omitempty"` - Expiry int64 `json:"expiry,omitempty"` + ActionerUserId string `json:"actionerUserId,omitempty"` + Comment string `json:"comment,omitempty"` + CreateInstant int64 `json:"createInstant,omitempty"` + Expiry int64 `json:"expiry,omitempty"` } type HTTPMethod string + const ( - HTTPMethod_GET HTTPMethod = "GET" - HTTPMethod_POST HTTPMethod = "POST" - HTTPMethod_PUT HTTPMethod = "PUT" - HTTPMethod_DELETE HTTPMethod = "DELETE" - HTTPMethod_HEAD HTTPMethod = "HEAD" - HTTPMethod_OPTIONS HTTPMethod = "OPTIONS" + HTTPMethod_GET HTTPMethod = "GET" + HTTPMethod_POST HTTPMethod = "POST" + HTTPMethod_PUT HTTPMethod = "PUT" + HTTPMethod_DELETE HTTPMethod = "DELETE" + HTTPMethod_HEAD HTTPMethod = "HEAD" + HTTPMethod_OPTIONS HTTPMethod = "OPTIONS" ) /** * @author Daniel DeGroff */ type HYPRApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration - LicensingEnabled bool `json:"licensingEnabled,omitempty"` - LicensingEnabledOverride bool `json:"licensingEnabledOverride,omitempty"` - LicensingURL string `json:"licensingURL,omitempty"` - RelyingPartyApplicationId string `json:"relyingPartyApplicationId,omitempty"` - RelyingPartyURL string `json:"relyingPartyURL,omitempty"` + BaseIdentityProviderApplicationConfiguration + LicensingEnabled bool `json:"licensingEnabled,omitempty"` + LicensingEnabledOverride bool `json:"licensingEnabledOverride,omitempty"` + LicensingURL string `json:"licensingURL,omitempty"` + RelyingPartyApplicationId string `json:"relyingPartyApplicationId,omitempty"` + RelyingPartyURL string `json:"relyingPartyURL,omitempty"` } /** * @author Daniel DeGroff */ type HYPRIdentityProvider struct { - BaseIdentityProvider - LicensingEnabled bool `json:"licensingEnabled,omitempty"` - LicensingURL string `json:"licensingURL,omitempty"` - RelyingPartyApplicationId string `json:"relyingPartyApplicationId,omitempty"` - RelyingPartyURL string `json:"relyingPartyURL,omitempty"` + BaseIdentityProvider + LicensingEnabled bool `json:"licensingEnabled,omitempty"` + LicensingURL string `json:"licensingURL,omitempty"` + RelyingPartyApplicationId string `json:"relyingPartyApplicationId,omitempty"` + RelyingPartyURL string `json:"relyingPartyURL,omitempty"` } type IdentityProviderDetails struct { - Id string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` - Type IdentityProviderType `json:"type,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` + Type IdentityProviderType `json:"type,omitempty"` } /** @@ -1153,74 +1179,77 @@ type IdentityProviderDetails struct { * @author Brian Pontarelli */ type IdentityProviderLoginRequest struct { - BaseLoginRequest - Data map[string]string `json:"data,omitempty"` - EncodedJWT string `json:"encodedJWT,omitempty"` - IdentityProviderId string `json:"identityProviderId,omitempty"` + BaseLoginRequest + Data map[string]string `json:"data,omitempty"` + EncodedJWT string `json:"encodedJWT,omitempty"` + IdentityProviderId string `json:"identityProviderId,omitempty"` } /** * @author Daniel DeGroff */ type IdentityProviderOauth2Configuration struct { - AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"` - ClientId string `json:"client_id,omitempty"` - ClientSecret string `json:"client_secret,omitempty"` - Issuer string `json:"issuer,omitempty"` - Scope string `json:"scope,omitempty"` - TokenEndpoint string `json:"token_endpoint,omitempty"` - UserinfoEndpoint string `json:"userinfo_endpoint,omitempty"` + AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"` + ClientId string `json:"client_id,omitempty"` + ClientSecret string `json:"client_secret,omitempty"` + Issuer string `json:"issuer,omitempty"` + Scope string `json:"scope,omitempty"` + TokenEndpoint string `json:"token_endpoint,omitempty"` + UserinfoEndpoint string `json:"userinfo_endpoint,omitempty"` } /** * @author Daniel DeGroff */ type IdentityProviderRequest struct { - IdentityProvider BaseIdentityProvider `json:"identityProvider,omitempty"` + IdentityProvider BaseIdentityProvider `json:"identityProvider,omitempty"` } /** * @author Daniel DeGroff */ type IdentityProviderResponse struct { - BaseHTTPResponse - IdentityProvider BaseIdentityProvider `json:"identityProvider,omitempty"` - IdentityProviders []BaseIdentityProvider `json:"identityProviders,omitempty"` + BaseHTTPResponse + IdentityProvider BaseIdentityProvider `json:"identityProvider,omitempty"` + IdentityProviders []BaseIdentityProvider `json:"identityProviders,omitempty"` } + func (b *IdentityProviderResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type IdentityProviderStartLoginRequest struct { - BaseLoginRequest - IdentityProviderId string `json:"identityProviderId,omitempty"` - LoginId string `json:"loginId,omitempty"` - State map[string]interface{} `json:"state,omitempty"` + BaseLoginRequest + IdentityProviderId string `json:"identityProviderId,omitempty"` + LoginId string `json:"loginId,omitempty"` + State map[string]interface{} `json:"state,omitempty"` } /** * @author Daniel DeGroff */ type IdentityProviderStartLoginResponse struct { - BaseHTTPResponse - Code string `json:"code,omitempty"` + BaseHTTPResponse + Code string `json:"code,omitempty"` } + func (b *IdentityProviderStartLoginResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type IdentityProviderType string + const ( - IdentityProviderType_ExternalJWT IdentityProviderType = "ExternalJWT" - IdentityProviderType_OpenIDConnect IdentityProviderType = "OpenIDConnect" - IdentityProviderType_Facebook IdentityProviderType = "Facebook" - IdentityProviderType_Google IdentityProviderType = "Google" - IdentityProviderType_Twitter IdentityProviderType = "Twitter" - IdentityProviderType_SAMLv2 IdentityProviderType = "SAMLv2" - IdentityProviderType_HYPR IdentityProviderType = "HYPR" + IdentityProviderType_ExternalJWT IdentityProviderType = "ExternalJWT" + IdentityProviderType_OpenIDConnect IdentityProviderType = "OpenIDConnect" + IdentityProviderType_Facebook IdentityProviderType = "Facebook" + IdentityProviderType_Google IdentityProviderType = "Google" + IdentityProviderType_Twitter IdentityProviderType = "Twitter" + IdentityProviderType_SAMLv2 IdentityProviderType = "SAMLv2" + IdentityProviderType_HYPR IdentityProviderType = "HYPR" ) /** @@ -1229,10 +1258,10 @@ const ( * @author Brian Pontarelli */ type ImportRequest struct { - EncryptionScheme string `json:"encryptionScheme,omitempty"` - Factor int `json:"factor,omitempty"` - Users []User `json:"users,omitempty"` - ValidateDbConstraints bool `json:"validateDbConstraints,omitempty"` + EncryptionScheme string `json:"encryptionScheme,omitempty"` + Factor int `json:"factor,omitempty"` + Users []User `json:"users,omitempty"` + ValidateDbConstraints bool `json:"validateDbConstraints,omitempty"` } /** @@ -1241,7 +1270,7 @@ type ImportRequest struct { * @author Daniel DeGroff */ type IntegrationRequest struct { - Integrations Integrations `json:"integrations,omitempty"` + Integrations Integrations `json:"integrations,omitempty"` } /** @@ -1250,11 +1279,12 @@ type IntegrationRequest struct { * @author Daniel DeGroff */ type IntegrationResponse struct { - BaseHTTPResponse - Integrations Integrations `json:"integrations,omitempty"` + BaseHTTPResponse + Integrations Integrations `json:"integrations,omitempty"` } + func (b *IntegrationResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1263,9 +1293,9 @@ func (b *IntegrationResponse) SetStatus(status int) { * @author Daniel DeGroff */ type Integrations struct { - Cleanspeak CleanSpeakConfiguration `json:"cleanspeak,omitempty"` - Kafka KafkaConfiguration `json:"kafka,omitempty"` - Twilio TwilioConfiguration `json:"twilio,omitempty"` + Cleanspeak CleanSpeakConfiguration `json:"cleanspeak,omitempty"` + Kafka KafkaConfiguration `json:"kafka,omitempty"` + Twilio TwilioConfiguration `json:"twilio,omitempty"` } /** @@ -1274,10 +1304,10 @@ type Integrations struct { * @author Brian Pontarelli */ type IntervalCount struct { - ApplicationId string `json:"applicationId,omitempty"` - Count int `json:"count,omitempty"` - DecrementedCount int `json:"decrementedCount,omitempty"` - Period int `json:"period,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + Count int `json:"count,omitempty"` + DecrementedCount int `json:"decrementedCount,omitempty"` + Period int `json:"period,omitempty"` } /** @@ -1286,21 +1316,22 @@ type IntervalCount struct { * @author Brian Pontarelli */ type IntervalUser struct { - ApplicationId string `json:"applicationId,omitempty"` - Period int `json:"period,omitempty"` - UserId string `json:"userId,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + Period int `json:"period,omitempty"` + UserId string `json:"userId,omitempty"` } /** * @author Daniel DeGroff */ type IssueResponse struct { - BaseHTTPResponse - RefreshToken string `json:"refreshToken,omitempty"` - Token string `json:"token,omitempty"` + BaseHTTPResponse + RefreshToken string `json:"refreshToken,omitempty"` + Token string `json:"token,omitempty"` } + func (b *IssueResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1310,36 +1341,37 @@ func (b *IssueResponse) SetStatus(status int) { * @author Daniel DeGroff */ type JSONWebKey struct { - Alg Algorithm `json:"alg,omitempty"` - Crv string `json:"crv,omitempty"` - D string `json:"d,omitempty"` - Dp string `json:"dp,omitempty"` - Dq string `json:"dq,omitempty"` - E string `json:"e,omitempty"` - Kid string `json:"kid,omitempty"` - Kty KeyType `json:"kty,omitempty"` - N string `json:"n,omitempty"` - Other map[string]interface{} `json:"other,omitempty"` - P string `json:"p,omitempty"` - Q string `json:"q,omitempty"` - Qi string `json:"qi,omitempty"` - Use string `json:"use,omitempty"` - X string `json:"x,omitempty"` - X5c []string `json:"x5c,omitempty"` - X5t string `json:"x5t,omitempty"` - X5t_S256 string `json:"x5t#S256,omitempty"` - Y string `json:"y,omitempty"` + Alg Algorithm `json:"alg,omitempty"` + Crv string `json:"crv,omitempty"` + D string `json:"d,omitempty"` + Dp string `json:"dp,omitempty"` + Dq string `json:"dq,omitempty"` + E string `json:"e,omitempty"` + Kid string `json:"kid,omitempty"` + Kty KeyType `json:"kty,omitempty"` + N string `json:"n,omitempty"` + Other map[string]interface{} `json:"other,omitempty"` + P string `json:"p,omitempty"` + Q string `json:"q,omitempty"` + Qi string `json:"qi,omitempty"` + Use string `json:"use,omitempty"` + X string `json:"x,omitempty"` + X5c []string `json:"x5c,omitempty"` + X5t string `json:"x5t,omitempty"` + X5t_S256 string `json:"x5t#S256,omitempty"` + Y string `json:"y,omitempty"` } /** * @author Daniel DeGroff */ type JWKSResponse struct { - BaseHTTPResponse - Keys []JSONWebKey `json:"keys,omitempty"` + BaseHTTPResponse + Keys []JSONWebKey `json:"keys,omitempty"` } + func (b *JWKSResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1353,14 +1385,14 @@ func (b *JWKSResponse) SetStatus(status int) { * @author Daniel DeGroff */ type JWT struct { - Aud interface{} `json:"aud,omitempty"` - Exp int64 `json:"exp,omitempty"` - Iat int64 `json:"iat,omitempty"` - Iss string `json:"iss,omitempty"` - Jti string `json:"jti,omitempty"` - Nbf int64 `json:"nbf,omitempty"` - OtherClaims map[string]interface{} `json:"otherClaims,omitempty"` - Sub string `json:"sub,omitempty"` + Aud interface{} `json:"aud,omitempty"` + Exp int64 `json:"exp,omitempty"` + Iat int64 `json:"iat,omitempty"` + Iss string `json:"iss,omitempty"` + Jti string `json:"jti,omitempty"` + Nbf int64 `json:"nbf,omitempty"` + OtherClaims map[string]interface{} `json:"otherClaims,omitempty"` + Sub string `json:"sub,omitempty"` } /** @@ -1370,11 +1402,11 @@ type JWT struct { * @author Daniel DeGroff */ type JWTConfiguration struct { - Enableable - AccessTokenKeyId string `json:"accessTokenKeyId,omitempty"` - IdTokenKeyId string `json:"idTokenKeyId,omitempty"` - RefreshTokenTimeToLiveInMinutes int `json:"refreshTokenTimeToLiveInMinutes,omitempty"` - TimeToLiveInSeconds int `json:"timeToLiveInSeconds,omitempty"` + Enableable + AccessTokenKeyId string `json:"accessTokenKeyId,omitempty"` + IdTokenKeyId string `json:"idTokenKeyId,omitempty"` + RefreshTokenTimeToLiveInMinutes int `json:"refreshTokenTimeToLiveInMinutes,omitempty"` + TimeToLiveInSeconds int `json:"timeToLiveInSeconds,omitempty"` } /** @@ -1384,8 +1416,8 @@ type JWTConfiguration struct { * @author Brian Pontarelli */ type JWTPublicKeyUpdateEvent struct { - BaseEvent - ApplicationIds []string `json:"applicationIds,omitempty"` + BaseEvent + ApplicationIds []string `json:"applicationIds,omitempty"` } /** @@ -1395,20 +1427,20 @@ type JWTPublicKeyUpdateEvent struct { * @author Brian Pontarelli */ type JWTRefreshTokenRevokeEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - ApplicationTimeToLiveInSeconds map[string]int `json:"applicationTimeToLiveInSeconds,omitempty"` - User User `json:"user,omitempty"` - UserId string `json:"userId,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + ApplicationTimeToLiveInSeconds map[string]int `json:"applicationTimeToLiveInSeconds,omitempty"` + User User `json:"user,omitempty"` + UserId string `json:"userId,omitempty"` } /** * @author Daniel DeGroff */ type KafkaConfiguration struct { - Enableable - DefaultTopic string `json:"defaultTopic,omitempty"` - Producer map[string]string `json:"producer,omitempty"` + Enableable + DefaultTopic string `json:"defaultTopic,omitempty"` + Producer map[string]string `json:"producer,omitempty"` } /** @@ -1417,34 +1449,35 @@ type KafkaConfiguration struct { * @author Brian Pontarelli */ type Key struct { - Algorithm KeyAlgorithm `json:"algorithm,omitempty"` - Certificate string `json:"certificate,omitempty"` - CertificateInformation CertificateInformation `json:"certificateInformation,omitempty"` - ExpirationInstant int64 `json:"expirationInstant,omitempty"` - Id string `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - Issuer string `json:"issuer,omitempty"` - Kid string `json:"kid,omitempty"` - Length int `json:"length,omitempty"` - Name string `json:"name,omitempty"` - Pair bool `json:"pair,omitempty"` - PrivateKey string `json:"privateKey,omitempty"` - PublicKey string `json:"publicKey,omitempty"` - Secret string `json:"secret,omitempty"` - Type KeyType `json:"type,omitempty"` + Algorithm KeyAlgorithm `json:"algorithm,omitempty"` + Certificate string `json:"certificate,omitempty"` + CertificateInformation CertificateInformation `json:"certificateInformation,omitempty"` + ExpirationInstant int64 `json:"expirationInstant,omitempty"` + Id string `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + Issuer string `json:"issuer,omitempty"` + Kid string `json:"kid,omitempty"` + Length int `json:"length,omitempty"` + Name string `json:"name,omitempty"` + Pair bool `json:"pair,omitempty"` + PrivateKey string `json:"privateKey,omitempty"` + PublicKey string `json:"publicKey,omitempty"` + Secret string `json:"secret,omitempty"` + Type KeyType `json:"type,omitempty"` } type KeyAlgorithm string + const ( - KeyAlgorithm_ES256 KeyAlgorithm = "ES256" - KeyAlgorithm_ES384 KeyAlgorithm = "ES384" - KeyAlgorithm_ES512 KeyAlgorithm = "ES512" - KeyAlgorithm_HS256 KeyAlgorithm = "HS256" - KeyAlgorithm_HS384 KeyAlgorithm = "HS384" - KeyAlgorithm_HS512 KeyAlgorithm = "HS512" - KeyAlgorithm_RS256 KeyAlgorithm = "RS256" - KeyAlgorithm_RS384 KeyAlgorithm = "RS384" - KeyAlgorithm_RS512 KeyAlgorithm = "RS512" + KeyAlgorithm_ES256 KeyAlgorithm = "ES256" + KeyAlgorithm_ES384 KeyAlgorithm = "ES384" + KeyAlgorithm_ES512 KeyAlgorithm = "ES512" + KeyAlgorithm_HS256 KeyAlgorithm = "HS256" + KeyAlgorithm_HS384 KeyAlgorithm = "HS384" + KeyAlgorithm_HS512 KeyAlgorithm = "HS512" + KeyAlgorithm_RS256 KeyAlgorithm = "RS256" + KeyAlgorithm_RS384 KeyAlgorithm = "RS384" + KeyAlgorithm_RS512 KeyAlgorithm = "RS512" ) /** @@ -1453,7 +1486,7 @@ const ( * @author Daniel DeGroff */ type KeyRequest struct { - Key Key `json:"key,omitempty"` + Key Key `json:"key,omitempty"` } /** @@ -1462,19 +1495,21 @@ type KeyRequest struct { * @author Daniel DeGroff */ type KeyResponse struct { - BaseHTTPResponse - Key Key `json:"key,omitempty"` - Keys []Key `json:"keys,omitempty"` + BaseHTTPResponse + Key Key `json:"key,omitempty"` + Keys []Key `json:"keys,omitempty"` } + func (b *KeyResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type KeyType string + const ( - KeyType_EC KeyType = "EC" - KeyType_RSA KeyType = "RSA" - KeyType_HMAC KeyType = "HMAC" + KeyType_EC KeyType = "EC" + KeyType_RSA KeyType = "RSA" + KeyType_HMAC KeyType = "HMAC" ) /** @@ -1483,23 +1518,23 @@ const ( * @author Brian Pontarelli */ type Lambda struct { - Enableable - Body string `json:"body,omitempty"` - Debug bool `json:"debug,omitempty"` - Id string `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - Name string `json:"name,omitempty"` - Type LambdaType `json:"type,omitempty"` + Enableable + Body string `json:"body,omitempty"` + Debug bool `json:"debug,omitempty"` + Id string `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + Name string `json:"name,omitempty"` + Type LambdaType `json:"type,omitempty"` } type LambdaConfiguration struct { - AccessTokenPopulateId string `json:"accessTokenPopulateId,omitempty"` - IdTokenPopulateId string `json:"idTokenPopulateId,omitempty"` - Samlv2PopulateId string `json:"samlv2PopulateId,omitempty"` + AccessTokenPopulateId string `json:"accessTokenPopulateId,omitempty"` + IdTokenPopulateId string `json:"idTokenPopulateId,omitempty"` + Samlv2PopulateId string `json:"samlv2PopulateId,omitempty"` } type ProviderLambdaConfiguration struct { - ReconcileId string `json:"reconcileId,omitempty"` + ReconcileId string `json:"reconcileId,omitempty"` } /** @@ -1508,7 +1543,7 @@ type ProviderLambdaConfiguration struct { * @author Brian Pontarelli */ type LambdaRequest struct { - Lambda Lambda `json:"lambda,omitempty"` + Lambda Lambda `json:"lambda,omitempty"` } /** @@ -1517,12 +1552,13 @@ type LambdaRequest struct { * @author Brian Pontarelli */ type LambdaResponse struct { - BaseHTTPResponse - Lambda Lambda `json:"lambda,omitempty"` - Lambdas []Lambda `json:"lambdas,omitempty"` + BaseHTTPResponse + Lambda Lambda `json:"lambda,omitempty"` + Lambdas []Lambda `json:"lambdas,omitempty"` } + func (b *LambdaResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1531,11 +1567,12 @@ func (b *LambdaResponse) SetStatus(status int) { * @author Brian Pontarelli */ type LambdaType string + const ( - LambdaType_JWTPopulate LambdaType = "JWTPopulate" - LambdaType_OpenIDReconcile LambdaType = "OpenIDReconcile" - LambdaType_SAMLv2Reconcile LambdaType = "SAMLv2Reconcile" - LambdaType_SAMLv2Populate LambdaType = "SAMLv2Populate" + LambdaType_JWTPopulate LambdaType = "JWTPopulate" + LambdaType_OpenIDReconcile LambdaType = "OpenIDReconcile" + LambdaType_SAMLv2Reconcile LambdaType = "SAMLv2Reconcile" + LambdaType_SAMLv2Populate LambdaType = "SAMLv2Populate" ) /** @@ -1544,19 +1581,20 @@ const ( * @author Brian Pontarelli */ type LogHistory struct { - HistoryItems []HistoryItem `json:"historyItems,omitempty"` + HistoryItems []HistoryItem `json:"historyItems,omitempty"` } type LoginConfiguration struct { - AllowTokenRefresh bool `json:"allowTokenRefresh,omitempty"` - GenerateRefreshTokens bool `json:"generateRefreshTokens,omitempty"` - RequireAuthentication bool `json:"requireAuthentication,omitempty"` + AllowTokenRefresh bool `json:"allowTokenRefresh,omitempty"` + GenerateRefreshTokens bool `json:"generateRefreshTokens,omitempty"` + RequireAuthentication bool `json:"requireAuthentication,omitempty"` } type LoginIdType string + const ( - LoginIdType_Email LoginIdType = "email" - LoginIdType_Username LoginIdType = "username" + LoginIdType_Email LoginIdType = "email" + LoginIdType_Username LoginIdType = "username" ) /** @@ -1565,51 +1603,52 @@ const ( * @author Daniel DeGroff */ type LoginPreventedResponse struct { - BaseHTTPResponse - ActionerUserId string `json:"actionerUserId,omitempty"` - ActionId string `json:"actionId,omitempty"` - Expiry int64 `json:"expiry,omitempty"` - LocalizedName string `json:"localizedName,omitempty"` - LocalizedOption string `json:"localizedOption,omitempty"` - LocalizedReason string `json:"localizedReason,omitempty"` - Name string `json:"name,omitempty"` - Option string `json:"option,omitempty"` - Reason string `json:"reason,omitempty"` - ReasonCode string `json:"reasonCode,omitempty"` + BaseHTTPResponse + ActionerUserId string `json:"actionerUserId,omitempty"` + ActionId string `json:"actionId,omitempty"` + Expiry int64 `json:"expiry,omitempty"` + LocalizedName string `json:"localizedName,omitempty"` + LocalizedOption string `json:"localizedOption,omitempty"` + LocalizedReason string `json:"localizedReason,omitempty"` + Name string `json:"name,omitempty"` + Option string `json:"option,omitempty"` + Reason string `json:"reason,omitempty"` + ReasonCode string `json:"reasonCode,omitempty"` } + func (b *LoginPreventedResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type LoginRecordConfiguration struct { - Delete DeleteConfiguration `json:"delete,omitempty"` + Delete DeleteConfiguration `json:"delete,omitempty"` } /** * @author Daniel DeGroff */ type LoginRecordExportRequest struct { - BaseExportRequest - Criteria LoginRecordSearchCriteria `json:"criteria,omitempty"` + BaseExportRequest + Criteria LoginRecordSearchCriteria `json:"criteria,omitempty"` } /** * @author Daniel DeGroff */ type LoginRecordSearchCriteria struct { - BaseSearchCriteria - ApplicationId string `json:"applicationId,omitempty"` - End int64 `json:"end,omitempty"` - Start int64 `json:"start,omitempty"` - UserId string `json:"userId,omitempty"` + BaseSearchCriteria + ApplicationId string `json:"applicationId,omitempty"` + End int64 `json:"end,omitempty"` + Start int64 `json:"start,omitempty"` + UserId string `json:"userId,omitempty"` } /** * @author Daniel DeGroff */ type LoginRecordSearchRequest struct { - RetrieveTotal bool `json:"retrieveTotal,omitempty"` - Search LoginRecordSearchCriteria `json:"search,omitempty"` + RetrieveTotal bool `json:"retrieveTotal,omitempty"` + Search LoginRecordSearchCriteria `json:"search,omitempty"` } /** @@ -1618,12 +1657,13 @@ type LoginRecordSearchRequest struct { * @author Daniel DeGroff */ type LoginRecordSearchResponse struct { - BaseHTTPResponse - Logins []DisplayableRawLogin `json:"logins,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + Logins []DisplayableRawLogin `json:"logins,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *LoginRecordSearchResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1632,12 +1672,13 @@ func (b *LoginRecordSearchResponse) SetStatus(status int) { * @author Brian Pontarelli */ type LoginReportResponse struct { - BaseHTTPResponse - HourlyCounts []Count `json:"hourlyCounts,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + HourlyCounts []Count `json:"hourlyCounts,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *LoginReportResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1646,57 +1687,60 @@ func (b *LoginReportResponse) SetStatus(status int) { * @author Seth Musselman */ type LoginRequest struct { - BaseLoginRequest - LoginId string `json:"loginId,omitempty"` - OneTimePassword string `json:"oneTimePassword,omitempty"` - Password string `json:"password,omitempty"` - TwoFactorTrustId string `json:"twoFactorTrustId,omitempty"` + BaseLoginRequest + LoginId string `json:"loginId,omitempty"` + OneTimePassword string `json:"oneTimePassword,omitempty"` + Password string `json:"password,omitempty"` + TwoFactorTrustId string `json:"twoFactorTrustId,omitempty"` } /** * @author Brian Pontarelli */ type LoginResponse struct { - BaseHTTPResponse - Actions []LoginPreventedResponse `json:"actions,omitempty"` - ChangePasswordId string `json:"changePasswordId,omitempty"` - RefreshToken string `json:"refreshToken,omitempty"` - State map[string]interface{} `json:"state,omitempty"` - Token string `json:"token,omitempty"` - TwoFactorId string `json:"twoFactorId,omitempty"` - TwoFactorTrustId string `json:"twoFactorTrustId,omitempty"` - User User `json:"user,omitempty"` + BaseHTTPResponse + Actions []LoginPreventedResponse `json:"actions,omitempty"` + ChangePasswordId string `json:"changePasswordId,omitempty"` + RefreshToken string `json:"refreshToken,omitempty"` + State map[string]interface{} `json:"state,omitempty"` + Token string `json:"token,omitempty"` + TwoFactorId string `json:"twoFactorId,omitempty"` + TwoFactorTrustId string `json:"twoFactorTrustId,omitempty"` + User User `json:"user,omitempty"` } + func (b *LoginResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Matthew Altman */ type LogoutBehavior string + const ( - LogoutBehavior_RedirectOnly LogoutBehavior = "RedirectOnly" - LogoutBehavior_AllApplications LogoutBehavior = "AllApplications" + LogoutBehavior_RedirectOnly LogoutBehavior = "RedirectOnly" + LogoutBehavior_AllApplications LogoutBehavior = "AllApplications" ) /** * @author Daniel DeGroff */ type LookupResponse struct { - BaseHTTPResponse - IdentityProvider IdentityProviderDetails `json:"identityProvider,omitempty"` + BaseHTTPResponse + IdentityProvider IdentityProviderDetails `json:"identityProvider,omitempty"` } + func (b *LookupResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type MaximumPasswordAge struct { - Enableable - Days int `json:"days,omitempty"` + Enableable + Days int `json:"days,omitempty"` } /** @@ -1705,8 +1749,8 @@ type MaximumPasswordAge struct { * @author Daniel DeGroff */ type MemberDeleteRequest struct { - MemberIds []string `json:"memberIds,omitempty"` - Members map[string][]string `json:"members,omitempty"` + MemberIds []string `json:"memberIds,omitempty"` + Members map[string][]string `json:"members,omitempty"` } /** @@ -1715,7 +1759,7 @@ type MemberDeleteRequest struct { * @author Daniel DeGroff */ type MemberRequest struct { - Members map[string][]GroupMember `json:"members,omitempty"` + Members map[string][]GroupMember `json:"members,omitempty"` } /** @@ -1724,24 +1768,25 @@ type MemberRequest struct { * @author Daniel DeGroff */ type MemberResponse struct { - BaseHTTPResponse - Members map[string][]GroupMember `json:"members,omitempty"` + BaseHTTPResponse + Members map[string][]GroupMember `json:"members,omitempty"` } + func (b *MemberResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type MetaData struct { - Device DeviceInfo `json:"device,omitempty"` - Scopes []string `json:"scopes,omitempty"` + Device DeviceInfo `json:"device,omitempty"` + Scopes []string `json:"scopes,omitempty"` } /** * @author Daniel DeGroff */ type MinimumPasswordAge struct { - Enableable - Seconds int `json:"seconds,omitempty"` + Enableable + Seconds int `json:"seconds,omitempty"` } /** @@ -1750,12 +1795,13 @@ type MinimumPasswordAge struct { * @author Brian Pontarelli */ type MonthlyActiveUserReportResponse struct { - BaseHTTPResponse - MonthlyActiveUsers []Count `json:"monthlyActiveUsers,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + MonthlyActiveUsers []Count `json:"monthlyActiveUsers,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *MonthlyActiveUserReportResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1770,115 +1816,119 @@ type Normalizer struct { * @author Daniel DeGroff */ type OAuth2Configuration struct { - AuthorizedOriginURLs []string `json:"authorizedOriginURLs,omitempty"` - AuthorizedRedirectURLs []string `json:"authorizedRedirectURLs,omitempty"` - ClientId string `json:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty"` - DeviceVerificationURL string `json:"deviceVerificationURL,omitempty"` - EnabledGrants []GrantType `json:"enabledGrants,omitempty"` - GenerateRefreshTokens bool `json:"generateRefreshTokens,omitempty"` - LogoutBehavior LogoutBehavior `json:"logoutBehavior,omitempty"` - LogoutURL string `json:"logoutURL,omitempty"` - RequireClientAuthentication bool `json:"requireClientAuthentication,omitempty"` + AuthorizedOriginURLs []string `json:"authorizedOriginURLs,omitempty"` + AuthorizedRedirectURLs []string `json:"authorizedRedirectURLs,omitempty"` + ClientId string `json:"clientId,omitempty"` + ClientSecret string `json:"clientSecret,omitempty"` + DeviceVerificationURL string `json:"deviceVerificationURL,omitempty"` + EnabledGrants []GrantType `json:"enabledGrants,omitempty"` + GenerateRefreshTokens bool `json:"generateRefreshTokens,omitempty"` + LogoutBehavior LogoutBehavior `json:"logoutBehavior,omitempty"` + LogoutURL string `json:"logoutURL,omitempty"` + RequireClientAuthentication bool `json:"requireClientAuthentication,omitempty"` } /** * @author Daniel DeGroff */ type OAuthConfigurationResponse struct { - BaseHTTPResponse - HttpSessionMaxInactiveInterval int `json:"httpSessionMaxInactiveInterval,omitempty"` - LogoutURL string `json:"logoutURL,omitempty"` - OauthConfiguration OAuth2Configuration `json:"oauthConfiguration,omitempty"` + BaseHTTPResponse + HttpSessionMaxInactiveInterval int `json:"httpSessionMaxInactiveInterval,omitempty"` + LogoutURL string `json:"logoutURL,omitempty"` + OauthConfiguration OAuth2Configuration `json:"oauthConfiguration,omitempty"` } + func (b *OAuthConfigurationResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type OAuthError struct { - ChangePasswordId string `json:"change_password_id,omitempty"` - Error OAuthErrorType `json:"error,omitempty"` - ErrorDescription string `json:"error_description,omitempty"` - ErrorReason OAuthErrorReason `json:"error_reason,omitempty"` - ErrorUri string `json:"error_uri,omitempty"` - TwoFactorId string `json:"two_factor_id,omitempty"` + ChangePasswordId string `json:"change_password_id,omitempty"` + Error OAuthErrorType `json:"error,omitempty"` + ErrorDescription string `json:"error_description,omitempty"` + ErrorReason OAuthErrorReason `json:"error_reason,omitempty"` + ErrorUri string `json:"error_uri,omitempty"` + TwoFactorId string `json:"two_factor_id,omitempty"` } type OAuthErrorReason string + const ( - OAuthErrorReason_AuthCodeNotFound OAuthErrorReason = "auth_code_not_found" - OAuthErrorReason_AccessTokenMalformed OAuthErrorReason = "access_token_malformed" - OAuthErrorReason_AccessTokenExpired OAuthErrorReason = "access_token_expired" - OAuthErrorReason_AccessTokenUnavailableForProcessing OAuthErrorReason = "access_token_unavailable_for_processing" - OAuthErrorReason_AccessTokenFailedProcessing OAuthErrorReason = "access_token_failed_processing" - OAuthErrorReason_RefreshTokenNotFound OAuthErrorReason = "refresh_token_not_found" - OAuthErrorReason_InvalidClientId OAuthErrorReason = "invalid_client_id" - OAuthErrorReason_InvalidUserCredentials OAuthErrorReason = "invalid_user_credentials" - OAuthErrorReason_InvalidGrantType OAuthErrorReason = "invalid_grant_type" - OAuthErrorReason_InvalidOrigin OAuthErrorReason = "invalid_origin" - OAuthErrorReason_InvalidOriginOpaque OAuthErrorReason = "invalid_origin_opaque" - OAuthErrorReason_InvalidPkceCodeVerifier OAuthErrorReason = "invalid_pkce_code_verifier" - OAuthErrorReason_InvalidPkceCodeChallenge OAuthErrorReason = "invalid_pkce_code_challenge" - OAuthErrorReason_InvalidPkceCodeChallengeMethod OAuthErrorReason = "invalid_pkce_code_challenge_method" - OAuthErrorReason_InvalidRedirectUri OAuthErrorReason = "invalid_redirect_uri" - OAuthErrorReason_InvalidResponseMode OAuthErrorReason = "invalid_response_mode" - OAuthErrorReason_InvalidResponseType OAuthErrorReason = "invalid_response_type" - OAuthErrorReason_InvalidIdTokenHint OAuthErrorReason = "invalid_id_token_hint" - OAuthErrorReason_InvalidPostLogoutRedirectUri OAuthErrorReason = "invalid_post_logout_redirect_uri" - OAuthErrorReason_InvalidDeviceCode OAuthErrorReason = "invalid_device_code" - OAuthErrorReason_InvalidUserCode OAuthErrorReason = "invalid_user_code" - OAuthErrorReason_InvalidAdditionalClientId OAuthErrorReason = "invalid_additional_client_id" - OAuthErrorReason_GrantTypeDisabled OAuthErrorReason = "grant_type_disabled" - OAuthErrorReason_MissingClientId OAuthErrorReason = "missing_client_id" - OAuthErrorReason_MissingCode OAuthErrorReason = "missing_code" - OAuthErrorReason_MissingDeviceCode OAuthErrorReason = "missing_device_code" - OAuthErrorReason_MissingGrantType OAuthErrorReason = "missing_grant_type" - OAuthErrorReason_MissingRedirectUri OAuthErrorReason = "missing_redirect_uri" - OAuthErrorReason_MissingRefreshToken OAuthErrorReason = "missing_refresh_token" - OAuthErrorReason_MissingResponseType OAuthErrorReason = "missing_response_type" - OAuthErrorReason_MissingToken OAuthErrorReason = "missing_token" - OAuthErrorReason_MissingUserCode OAuthErrorReason = "missing_user_code" - OAuthErrorReason_MissingVerificationUri OAuthErrorReason = "missing_verification_uri" - OAuthErrorReason_LoginPrevented OAuthErrorReason = "login_prevented" - OAuthErrorReason_UserCodeExpired OAuthErrorReason = "user_code_expired" - OAuthErrorReason_UserExpired OAuthErrorReason = "user_expired" - OAuthErrorReason_UserLocked OAuthErrorReason = "user_locked" - OAuthErrorReason_UserNotFound OAuthErrorReason = "user_not_found" - OAuthErrorReason_ClientAuthenticationMissing OAuthErrorReason = "client_authentication_missing" - OAuthErrorReason_InvalidClientAuthenticationScheme OAuthErrorReason = "invalid_client_authentication_scheme" - OAuthErrorReason_InvalidClientAuthentication OAuthErrorReason = "invalid_client_authentication" - OAuthErrorReason_ClientIdMismatch OAuthErrorReason = "client_id_mismatch" - OAuthErrorReason_Unknown OAuthErrorReason = "unknown" + OAuthErrorReason_AuthCodeNotFound OAuthErrorReason = "auth_code_not_found" + OAuthErrorReason_AccessTokenMalformed OAuthErrorReason = "access_token_malformed" + OAuthErrorReason_AccessTokenExpired OAuthErrorReason = "access_token_expired" + OAuthErrorReason_AccessTokenUnavailableForProcessing OAuthErrorReason = "access_token_unavailable_for_processing" + OAuthErrorReason_AccessTokenFailedProcessing OAuthErrorReason = "access_token_failed_processing" + OAuthErrorReason_RefreshTokenNotFound OAuthErrorReason = "refresh_token_not_found" + OAuthErrorReason_InvalidClientId OAuthErrorReason = "invalid_client_id" + OAuthErrorReason_InvalidUserCredentials OAuthErrorReason = "invalid_user_credentials" + OAuthErrorReason_InvalidGrantType OAuthErrorReason = "invalid_grant_type" + OAuthErrorReason_InvalidOrigin OAuthErrorReason = "invalid_origin" + OAuthErrorReason_InvalidOriginOpaque OAuthErrorReason = "invalid_origin_opaque" + OAuthErrorReason_InvalidPkceCodeVerifier OAuthErrorReason = "invalid_pkce_code_verifier" + OAuthErrorReason_InvalidPkceCodeChallenge OAuthErrorReason = "invalid_pkce_code_challenge" + OAuthErrorReason_InvalidPkceCodeChallengeMethod OAuthErrorReason = "invalid_pkce_code_challenge_method" + OAuthErrorReason_InvalidRedirectUri OAuthErrorReason = "invalid_redirect_uri" + OAuthErrorReason_InvalidResponseMode OAuthErrorReason = "invalid_response_mode" + OAuthErrorReason_InvalidResponseType OAuthErrorReason = "invalid_response_type" + OAuthErrorReason_InvalidIdTokenHint OAuthErrorReason = "invalid_id_token_hint" + OAuthErrorReason_InvalidPostLogoutRedirectUri OAuthErrorReason = "invalid_post_logout_redirect_uri" + OAuthErrorReason_InvalidDeviceCode OAuthErrorReason = "invalid_device_code" + OAuthErrorReason_InvalidUserCode OAuthErrorReason = "invalid_user_code" + OAuthErrorReason_InvalidAdditionalClientId OAuthErrorReason = "invalid_additional_client_id" + OAuthErrorReason_GrantTypeDisabled OAuthErrorReason = "grant_type_disabled" + OAuthErrorReason_MissingClientId OAuthErrorReason = "missing_client_id" + OAuthErrorReason_MissingCode OAuthErrorReason = "missing_code" + OAuthErrorReason_MissingDeviceCode OAuthErrorReason = "missing_device_code" + OAuthErrorReason_MissingGrantType OAuthErrorReason = "missing_grant_type" + OAuthErrorReason_MissingRedirectUri OAuthErrorReason = "missing_redirect_uri" + OAuthErrorReason_MissingRefreshToken OAuthErrorReason = "missing_refresh_token" + OAuthErrorReason_MissingResponseType OAuthErrorReason = "missing_response_type" + OAuthErrorReason_MissingToken OAuthErrorReason = "missing_token" + OAuthErrorReason_MissingUserCode OAuthErrorReason = "missing_user_code" + OAuthErrorReason_MissingVerificationUri OAuthErrorReason = "missing_verification_uri" + OAuthErrorReason_LoginPrevented OAuthErrorReason = "login_prevented" + OAuthErrorReason_UserCodeExpired OAuthErrorReason = "user_code_expired" + OAuthErrorReason_UserExpired OAuthErrorReason = "user_expired" + OAuthErrorReason_UserLocked OAuthErrorReason = "user_locked" + OAuthErrorReason_UserNotFound OAuthErrorReason = "user_not_found" + OAuthErrorReason_ClientAuthenticationMissing OAuthErrorReason = "client_authentication_missing" + OAuthErrorReason_InvalidClientAuthenticationScheme OAuthErrorReason = "invalid_client_authentication_scheme" + OAuthErrorReason_InvalidClientAuthentication OAuthErrorReason = "invalid_client_authentication" + OAuthErrorReason_ClientIdMismatch OAuthErrorReason = "client_id_mismatch" + OAuthErrorReason_Unknown OAuthErrorReason = "unknown" ) type OAuthErrorType string + const ( - OAuthErrorType_InvalidRequest OAuthErrorType = "invalid_request" - OAuthErrorType_InvalidClient OAuthErrorType = "invalid_client" - OAuthErrorType_InvalidGrant OAuthErrorType = "invalid_grant" - OAuthErrorType_InvalidToken OAuthErrorType = "invalid_token" - OAuthErrorType_UnauthorizedClient OAuthErrorType = "unauthorized_client" - OAuthErrorType_InvalidScope OAuthErrorType = "invalid_scope" - OAuthErrorType_ServerError OAuthErrorType = "server_error" - OAuthErrorType_UnsupportedGrantType OAuthErrorType = "unsupported_grant_type" - OAuthErrorType_UnsupportedResponseType OAuthErrorType = "unsupported_response_type" - OAuthErrorType_ChangePasswordRequired OAuthErrorType = "change_password_required" - OAuthErrorType_TwoFactorRequired OAuthErrorType = "two_factor_required" - OAuthErrorType_AuthorizationPending OAuthErrorType = "authorization_pending" - OAuthErrorType_ExpiredToken OAuthErrorType = "expired_token" + OAuthErrorType_InvalidRequest OAuthErrorType = "invalid_request" + OAuthErrorType_InvalidClient OAuthErrorType = "invalid_client" + OAuthErrorType_InvalidGrant OAuthErrorType = "invalid_grant" + OAuthErrorType_InvalidToken OAuthErrorType = "invalid_token" + OAuthErrorType_UnauthorizedClient OAuthErrorType = "unauthorized_client" + OAuthErrorType_InvalidScope OAuthErrorType = "invalid_scope" + OAuthErrorType_ServerError OAuthErrorType = "server_error" + OAuthErrorType_UnsupportedGrantType OAuthErrorType = "unsupported_grant_type" + OAuthErrorType_UnsupportedResponseType OAuthErrorType = "unsupported_response_type" + OAuthErrorType_ChangePasswordRequired OAuthErrorType = "change_password_required" + OAuthErrorType_TwoFactorRequired OAuthErrorType = "two_factor_required" + OAuthErrorType_AuthorizationPending OAuthErrorType = "authorization_pending" + OAuthErrorType_ExpiredToken OAuthErrorType = "expired_token" ) /** * @author Daniel DeGroff */ type OAuthResponse struct { - BaseHTTPResponse + BaseHTTPResponse } + func (b *OAuthResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -1888,50 +1938,51 @@ func (b *OAuthResponse) SetStatus(status int) { * @author Daniel DeGroff */ type OpenIdConfiguration struct { - BaseHTTPResponse - AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"` - BackchannelLogoutSupported bool `json:"backchannel_logout_supported,omitempty"` - ClaimsSupported []string `json:"claims_supported,omitempty"` - DeviceAuthorizationEndpoint string `json:"device_authorization_endpoint,omitempty"` - EndSessionEndpoint string `json:"end_session_endpoint,omitempty"` - FrontchannelLogoutSupported bool `json:"frontchannel_logout_supported,omitempty"` - GrantTypesSupported []string `json:"grant_types_supported,omitempty"` - IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"` - Issuer string `json:"issuer,omitempty"` - JwksUri string `json:"jwks_uri,omitempty"` - ResponseModesSupported []string `json:"response_modes_supported,omitempty"` - ResponseTypesSupported []string `json:"response_types_supported,omitempty"` - ScopesSupported []string `json:"scopes_supported,omitempty"` - SubjectTypesSupported []string `json:"subject_types_supported,omitempty"` - TokenEndpoint string `json:"token_endpoint,omitempty"` - TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"` - UserinfoEndpoint string `json:"userinfo_endpoint,omitempty"` - UserinfoSigningAlgValuesSupported []string `json:"userinfo_signing_alg_values_supported,omitempty"` + BaseHTTPResponse + AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"` + BackchannelLogoutSupported bool `json:"backchannel_logout_supported,omitempty"` + ClaimsSupported []string `json:"claims_supported,omitempty"` + DeviceAuthorizationEndpoint string `json:"device_authorization_endpoint,omitempty"` + EndSessionEndpoint string `json:"end_session_endpoint,omitempty"` + FrontchannelLogoutSupported bool `json:"frontchannel_logout_supported,omitempty"` + GrantTypesSupported []string `json:"grant_types_supported,omitempty"` + IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"` + Issuer string `json:"issuer,omitempty"` + JwksUri string `json:"jwks_uri,omitempty"` + ResponseModesSupported []string `json:"response_modes_supported,omitempty"` + ResponseTypesSupported []string `json:"response_types_supported,omitempty"` + ScopesSupported []string `json:"scopes_supported,omitempty"` + SubjectTypesSupported []string `json:"subject_types_supported,omitempty"` + TokenEndpoint string `json:"token_endpoint,omitempty"` + TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"` + UserinfoEndpoint string `json:"userinfo_endpoint,omitempty"` + UserinfoSigningAlgValuesSupported []string `json:"userinfo_signing_alg_values_supported,omitempty"` } + func (b *OpenIdConfiguration) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type OpenIdConnectApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration - ButtonImageURL string `json:"buttonImageURL,omitempty"` - ButtonText string `json:"buttonText,omitempty"` - Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` + BaseIdentityProviderApplicationConfiguration + ButtonImageURL string `json:"buttonImageURL,omitempty"` + ButtonText string `json:"buttonText,omitempty"` + Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` } /** * @author Daniel DeGroff */ type OpenIdConnectIdentityProvider struct { - BaseIdentityProvider - ButtonImageURL string `json:"buttonImageURL,omitempty"` - ButtonText string `json:"buttonText,omitempty"` - Domains []string `json:"domains,omitempty"` - LambdaConfiguration ProviderLambdaConfiguration `json:"lambdaConfiguration,omitempty"` - Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` + BaseIdentityProvider + ButtonImageURL string `json:"buttonImageURL,omitempty"` + ButtonText string `json:"buttonText,omitempty"` + Domains []string `json:"domains,omitempty"` + LambdaConfiguration ProviderLambdaConfiguration `json:"lambdaConfiguration,omitempty"` + Oauth2 IdentityProviderOauth2Configuration `json:"oauth2,omitempty"` } /** @@ -1940,13 +1991,13 @@ type OpenIdConnectIdentityProvider struct { * @author Daniel DeGroff */ type PasswordEncryptionConfiguration struct { - EncryptionScheme string `json:"encryptionScheme,omitempty"` - EncryptionSchemeFactor int `json:"encryptionSchemeFactor,omitempty"` - ModifyEncryptionSchemeOnLogin bool `json:"modifyEncryptionSchemeOnLogin,omitempty"` + EncryptionScheme string `json:"encryptionScheme,omitempty"` + EncryptionSchemeFactor int `json:"encryptionSchemeFactor,omitempty"` + ModifyEncryptionSchemeOnLogin bool `json:"modifyEncryptionSchemeOnLogin,omitempty"` } type PasswordlessConfiguration struct { - Enableable + Enableable } /** @@ -1959,93 +2010,97 @@ type PasswordlessIdentityProvider struct { * @author Daniel DeGroff */ type PasswordlessLoginRequest struct { - BaseLoginRequest - Code string `json:"code,omitempty"` - TwoFactorTrustId string `json:"twoFactorTrustId,omitempty"` + BaseLoginRequest + Code string `json:"code,omitempty"` + TwoFactorTrustId string `json:"twoFactorTrustId,omitempty"` } /** * @author Daniel DeGroff */ type PasswordlessSendRequest struct { - ApplicationId string `json:"applicationId,omitempty"` - Code string `json:"code,omitempty"` - LoginId string `json:"loginId,omitempty"` - State map[string]interface{} `json:"state,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + Code string `json:"code,omitempty"` + LoginId string `json:"loginId,omitempty"` + State map[string]interface{} `json:"state,omitempty"` } /** * @author Daniel DeGroff */ type PasswordlessStartRequest struct { - ApplicationId string `json:"applicationId,omitempty"` - LoginId string `json:"loginId,omitempty"` - State map[string]interface{} `json:"state,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + LoginId string `json:"loginId,omitempty"` + State map[string]interface{} `json:"state,omitempty"` } /** * @author Daniel DeGroff */ type PasswordlessStartResponse struct { - BaseHTTPResponse - Code string `json:"code,omitempty"` + BaseHTTPResponse + Code string `json:"code,omitempty"` } + func (b *PasswordlessStartResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Derek Klatt */ type PasswordValidationRules struct { - MaxLength int `json:"maxLength,omitempty"` - MinLength int `json:"minLength,omitempty"` - RememberPreviousPasswords RememberPreviousPasswords `json:"rememberPreviousPasswords,omitempty"` - RequireMixedCase bool `json:"requireMixedCase,omitempty"` - RequireNonAlpha bool `json:"requireNonAlpha,omitempty"` - RequireNumber bool `json:"requireNumber,omitempty"` + MaxLength int `json:"maxLength,omitempty"` + MinLength int `json:"minLength,omitempty"` + RememberPreviousPasswords RememberPreviousPasswords `json:"rememberPreviousPasswords,omitempty"` + RequireMixedCase bool `json:"requireMixedCase,omitempty"` + RequireNonAlpha bool `json:"requireNonAlpha,omitempty"` + RequireNumber bool `json:"requireNumber,omitempty"` } /** * @author Daniel DeGroff */ type PasswordValidationRulesResponse struct { - BaseHTTPResponse - PasswordValidationRules PasswordValidationRules `json:"passwordValidationRules,omitempty"` + BaseHTTPResponse + PasswordValidationRules PasswordValidationRules `json:"passwordValidationRules,omitempty"` } + func (b *PasswordValidationRulesResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Brian Pontarelli */ type PendingResponse struct { - BaseHTTPResponse - Users []User `json:"users,omitempty"` + BaseHTTPResponse + Users []User `json:"users,omitempty"` } + func (b *PendingResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Brian Pontarelli */ type PreviewRequest struct { - EmailTemplate EmailTemplate `json:"emailTemplate,omitempty"` - Locale string `json:"locale,omitempty"` + EmailTemplate EmailTemplate `json:"emailTemplate,omitempty"` + Locale string `json:"locale,omitempty"` } /** * @author Seth Musselman */ type PreviewResponse struct { - BaseHTTPResponse - Email Email `json:"email,omitempty"` - Errors Errors `json:"errors,omitempty"` + BaseHTTPResponse + Email Email `json:"email,omitempty"` + Errors Errors `json:"errors,omitempty"` } + func (b *PreviewResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2054,12 +2109,13 @@ func (b *PreviewResponse) SetStatus(status int) { * @author Daniel DeGroff */ type PublicKeyResponse struct { - BaseHTTPResponse - PublicKey string `json:"publicKey,omitempty"` - PublicKeys map[string]string `json:"publicKeys,omitempty"` + BaseHTTPResponse + PublicKey string `json:"publicKey,omitempty"` + PublicKeys map[string]string `json:"publicKeys,omitempty"` } + func (b *PublicKeyResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2068,10 +2124,10 @@ func (b *PublicKeyResponse) SetStatus(status int) { * @author Brian Pontarelli */ type RawLogin struct { - ApplicationId string `json:"applicationId,omitempty"` - Instant int64 `json:"instant,omitempty"` - IpAddress string `json:"ipAddress,omitempty"` - UserId string `json:"userId,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + Instant int64 `json:"instant,omitempty"` + IpAddress string `json:"ipAddress,omitempty"` + UserId string `json:"userId,omitempty"` } /** @@ -2080,30 +2136,32 @@ type RawLogin struct { * @author Seth Musselman */ type RecentLoginResponse struct { - BaseHTTPResponse - Logins []DisplayableRawLogin `json:"logins,omitempty"` + BaseHTTPResponse + Logins []DisplayableRawLogin `json:"logins,omitempty"` } + func (b *RecentLoginResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type RefreshRequest struct { - RefreshToken string `json:"refreshToken,omitempty"` + RefreshToken string `json:"refreshToken,omitempty"` } /** * @author Daniel DeGroff */ type RefreshResponse struct { - BaseHTTPResponse - RefreshTokens []RefreshToken `json:"refreshTokens,omitempty"` - Token string `json:"token,omitempty"` + BaseHTTPResponse + RefreshTokens []RefreshToken `json:"refreshTokens,omitempty"` + Token string `json:"token,omitempty"` } + func (b *RefreshResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2112,24 +2170,24 @@ func (b *RefreshResponse) SetStatus(status int) { * @author Daniel DeGroff */ type RefreshToken struct { - ApplicationId string `json:"applicationId,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - MetaData MetaData `json:"metaData,omitempty"` - StartInstant int64 `json:"startInstant,omitempty"` - Token string `json:"token,omitempty"` - UserId string `json:"userId,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + MetaData MetaData `json:"metaData,omitempty"` + StartInstant int64 `json:"startInstant,omitempty"` + Token string `json:"token,omitempty"` + UserId string `json:"userId,omitempty"` } type RegistrationConfiguration struct { - Enableable - BirthDate Requirable `json:"birthDate,omitempty"` - ConfirmPassword bool `json:"confirmPassword,omitempty"` - FirstName Requirable `json:"firstName,omitempty"` - FullName Requirable `json:"fullName,omitempty"` - LastName Requirable `json:"lastName,omitempty"` - LoginIdType LoginIdType `json:"loginIdType,omitempty"` - MiddleName Requirable `json:"middleName,omitempty"` - MobilePhone Requirable `json:"mobilePhone,omitempty"` + Enableable + BirthDate Requirable `json:"birthDate,omitempty"` + ConfirmPassword bool `json:"confirmPassword,omitempty"` + FirstName Requirable `json:"firstName,omitempty"` + FullName Requirable `json:"fullName,omitempty"` + LastName Requirable `json:"lastName,omitempty"` + LoginIdType LoginIdType `json:"loginIdType,omitempty"` + MiddleName Requirable `json:"middleName,omitempty"` + MobilePhone Requirable `json:"mobilePhone,omitempty"` } /** @@ -2138,12 +2196,13 @@ type RegistrationConfiguration struct { * @author Brian Pontarelli */ type RegistrationReportResponse struct { - BaseHTTPResponse - HourlyCounts []Count `json:"hourlyCounts,omitempty"` - Total int64 `json:"total,omitempty"` + BaseHTTPResponse + HourlyCounts []Count `json:"hourlyCounts,omitempty"` + Total int64 `json:"total,omitempty"` } + func (b *RegistrationReportResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2152,12 +2211,12 @@ func (b *RegistrationReportResponse) SetStatus(status int) { * @author Brian Pontarelli */ type RegistrationRequest struct { - GenerateAuthenticationToken bool `json:"generateAuthenticationToken,omitempty"` - Registration UserRegistration `json:"registration,omitempty"` - SendSetPasswordEmail bool `json:"sendSetPasswordEmail,omitempty"` - SkipRegistrationVerification bool `json:"skipRegistrationVerification,omitempty"` - SkipVerification bool `json:"skipVerification,omitempty"` - User User `json:"user,omitempty"` + GenerateAuthenticationToken bool `json:"generateAuthenticationToken,omitempty"` + Registration UserRegistration `json:"registration,omitempty"` + SendSetPasswordEmail bool `json:"sendSetPasswordEmail,omitempty"` + SkipRegistrationVerification bool `json:"skipRegistrationVerification,omitempty"` + SkipVerification bool `json:"skipVerification,omitempty"` + User User `json:"user,omitempty"` } /** @@ -2166,27 +2225,28 @@ type RegistrationRequest struct { * @author Brian Pontarelli */ type RegistrationResponse struct { - BaseHTTPResponse - Registration UserRegistration `json:"registration,omitempty"` - User User `json:"user,omitempty"` + BaseHTTPResponse + Registration UserRegistration `json:"registration,omitempty"` + User User `json:"user,omitempty"` } + func (b *RegistrationResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type ReloadRequest struct { - Names []string `json:"names,omitempty"` + Names []string `json:"names,omitempty"` } /** * @author Daniel DeGroff */ type RememberPreviousPasswords struct { - Enableable - Count int `json:"count,omitempty"` + Enableable + Count int `json:"count,omitempty"` } /** @@ -2196,28 +2256,28 @@ type RememberPreviousPasswords struct { * @author Brian Pontarelli */ type Requirable struct { - Enableable - Required bool `json:"required,omitempty"` + Enableable + Required bool `json:"required,omitempty"` } /** * @author Brian Pontarelli */ type SAMLv2ApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration - ButtonImageURL string `json:"buttonImageURL,omitempty"` - ButtonText string `json:"buttonText,omitempty"` + BaseIdentityProviderApplicationConfiguration + ButtonImageURL string `json:"buttonImageURL,omitempty"` + ButtonText string `json:"buttonText,omitempty"` } type SAMLv2Configuration struct { - Enableable - Audience string `json:"audience,omitempty"` - CallbackURL string `json:"callbackURL,omitempty"` - Debug bool `json:"debug,omitempty"` - Issuer string `json:"issuer,omitempty"` - KeyId string `json:"keyId,omitempty"` - LogoutURL string `json:"logoutURL,omitempty"` - XmlSignatureC14nMethod CanonicalizationMethod `json:"xmlSignatureC14nMethod,omitempty"` + Enableable + Audience string `json:"audience,omitempty"` + CallbackURL string `json:"callbackURL,omitempty"` + Debug bool `json:"debug,omitempty"` + Issuer string `json:"issuer,omitempty"` + KeyId string `json:"keyId,omitempty"` + LogoutURL string `json:"logoutURL,omitempty"` + XmlSignatureC14nMethod CanonicalizationMethod `json:"xmlSignatureC14nMethod,omitempty"` } /** @@ -2226,16 +2286,16 @@ type SAMLv2Configuration struct { * @author Brian Pontarelli */ type SAMLv2IdentityProvider struct { - BaseIdentityProvider - ButtonImageURL string `json:"buttonImageURL,omitempty"` - ButtonText string `json:"buttonText,omitempty"` - Domains []string `json:"domains,omitempty"` - EmailClaim string `json:"emailClaim,omitempty"` - IdpEndpoint string `json:"idpEndpoint,omitempty"` - Issuer string `json:"issuer,omitempty"` - KeyId string `json:"keyId,omitempty"` - LambdaConfiguration ProviderLambdaConfiguration `json:"lambdaConfiguration,omitempty"` - UseNameIdForEmail bool `json:"useNameIdForEmail,omitempty"` + BaseIdentityProvider + ButtonImageURL string `json:"buttonImageURL,omitempty"` + ButtonText string `json:"buttonText,omitempty"` + Domains []string `json:"domains,omitempty"` + EmailClaim string `json:"emailClaim,omitempty"` + IdpEndpoint string `json:"idpEndpoint,omitempty"` + Issuer string `json:"issuer,omitempty"` + KeyId string `json:"keyId,omitempty"` + LambdaConfiguration ProviderLambdaConfiguration `json:"lambdaConfiguration,omitempty"` + UseNameIdForEmail bool `json:"useNameIdForEmail,omitempty"` } /** @@ -2244,7 +2304,7 @@ type SAMLv2IdentityProvider struct { * @author Brian Pontarelli */ type SearchRequest struct { - Search UserSearchCriteria `json:"search,omitempty"` + Search UserSearchCriteria `json:"search,omitempty"` } /** @@ -2253,12 +2313,13 @@ type SearchRequest struct { * @author Brian Pontarelli */ type SearchResponse struct { - BaseHTTPResponse - Total int64 `json:"total,omitempty"` - Users []User `json:"users,omitempty"` + BaseHTTPResponse + Total int64 `json:"total,omitempty"` + Users []User `json:"users,omitempty"` } + func (b *SearchResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2267,107 +2328,111 @@ func (b *SearchResponse) SetStatus(status int) { * @author Brian Pontarelli */ type SearchResults struct { - Results []interface{} `json:"results,omitempty"` - Total int64 `json:"total,omitempty"` + Results []interface{} `json:"results,omitempty"` + Total int64 `json:"total,omitempty"` } /** * @author Daniel DeGroff */ type SecretResponse struct { - BaseHTTPResponse - Secret string `json:"secret,omitempty"` - SecretBase32Encoded string `json:"secretBase32Encoded,omitempty"` + BaseHTTPResponse + Secret string `json:"secret,omitempty"` + SecretBase32Encoded string `json:"secretBase32Encoded,omitempty"` } + func (b *SecretResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type SecureGeneratorConfiguration struct { - Length int `json:"length,omitempty"` - Type SecureGeneratorType `json:"type,omitempty"` + Length int `json:"length,omitempty"` + Type SecureGeneratorType `json:"type,omitempty"` } /** * @author Daniel DeGroff */ type SecureGeneratorType string + const ( - SecureGeneratorType_RandomDigits SecureGeneratorType = "randomDigits" - SecureGeneratorType_RandomBytes SecureGeneratorType = "randomBytes" - SecureGeneratorType_RandomAlpha SecureGeneratorType = "randomAlpha" - SecureGeneratorType_RandomAlphaNumeric SecureGeneratorType = "randomAlphaNumeric" + SecureGeneratorType_RandomDigits SecureGeneratorType = "randomDigits" + SecureGeneratorType_RandomBytes SecureGeneratorType = "randomBytes" + SecureGeneratorType_RandomAlpha SecureGeneratorType = "randomAlpha" + SecureGeneratorType_RandomAlphaNumeric SecureGeneratorType = "randomAlphaNumeric" ) /** * @author Daniel DeGroff */ type SecureIdentity struct { - EncryptionScheme string `json:"encryptionScheme,omitempty"` - Factor int `json:"factor,omitempty"` - Id string `json:"id,omitempty"` - Password string `json:"password,omitempty"` - PasswordChangeRequired bool `json:"passwordChangeRequired,omitempty"` - PasswordLastUpdateInstant int64 `json:"passwordLastUpdateInstant,omitempty"` - Salt string `json:"salt,omitempty"` - Verified bool `json:"verified,omitempty"` + EncryptionScheme string `json:"encryptionScheme,omitempty"` + Factor int `json:"factor,omitempty"` + Id string `json:"id,omitempty"` + Password string `json:"password,omitempty"` + PasswordChangeRequired bool `json:"passwordChangeRequired,omitempty"` + PasswordLastUpdateInstant int64 `json:"passwordLastUpdateInstant,omitempty"` + Salt string `json:"salt,omitempty"` + Verified bool `json:"verified,omitempty"` } /** * @author Daniel DeGroff */ type SendRequest struct { - BccAddresses []string `json:"bccAddresses,omitempty"` - CcAddresses []string `json:"ccAddresses,omitempty"` - RequestData map[string]interface{} `json:"requestData,omitempty"` - UserIds []string `json:"userIds,omitempty"` + BccAddresses []string `json:"bccAddresses,omitempty"` + CcAddresses []string `json:"ccAddresses,omitempty"` + RequestData map[string]interface{} `json:"requestData,omitempty"` + UserIds []string `json:"userIds,omitempty"` } /** * @author Daniel DeGroff */ type SendResponse struct { - BaseHTTPResponse - Results map[string]EmailTemplateErrors `json:"results,omitempty"` + BaseHTTPResponse + Results map[string]EmailTemplateErrors `json:"results,omitempty"` } + func (b *SendResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type Sort string + const ( - Sort_Asc Sort = "asc" - Sort_Desc Sort = "desc" + Sort_Asc Sort = "asc" + Sort_Desc Sort = "desc" ) /** * @author Daniel DeGroff */ type SortField struct { - Missing string `json:"missing,omitempty"` - Name string `json:"name,omitempty"` - Order Sort `json:"order,omitempty"` + Missing string `json:"missing,omitempty"` + Name string `json:"name,omitempty"` + Order Sort `json:"order,omitempty"` } /** * @author Brian Pontarelli */ type SystemConfiguration struct { - AuditLogConfiguration AuditLogConfiguration `json:"auditLogConfiguration,omitempty"` - CookieEncryptionIV string `json:"cookieEncryptionIV,omitempty"` - CookieEncryptionKey string `json:"cookieEncryptionKey,omitempty"` - CorsConfiguration CORSConfiguration `json:"corsConfiguration,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - EventLogConfiguration EventLogConfiguration `json:"eventLogConfiguration,omitempty"` - LoginRecordConfiguration LoginRecordConfiguration `json:"loginRecordConfiguration,omitempty"` - ReportTimezone string `json:"reportTimezone,omitempty"` - UiConfiguration UIConfiguration `json:"uiConfiguration,omitempty"` + AuditLogConfiguration AuditLogConfiguration `json:"auditLogConfiguration,omitempty"` + CookieEncryptionIV string `json:"cookieEncryptionIV,omitempty"` + CookieEncryptionKey string `json:"cookieEncryptionKey,omitempty"` + CorsConfiguration CORSConfiguration `json:"corsConfiguration,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + EventLogConfiguration EventLogConfiguration `json:"eventLogConfiguration,omitempty"` + LoginRecordConfiguration LoginRecordConfiguration `json:"loginRecordConfiguration,omitempty"` + ReportTimezone string `json:"reportTimezone,omitempty"` + UiConfiguration UIConfiguration `json:"uiConfiguration,omitempty"` } /** @@ -2376,7 +2441,7 @@ type SystemConfiguration struct { * @author Brian Pontarelli */ type SystemConfigurationRequest struct { - SystemConfiguration SystemConfiguration `json:"systemConfiguration,omitempty"` + SystemConfiguration SystemConfiguration `json:"systemConfiguration,omitempty"` } /** @@ -2385,62 +2450,63 @@ type SystemConfigurationRequest struct { * @author Brian Pontarelli */ type SystemConfigurationResponse struct { - BaseHTTPResponse - SystemConfiguration SystemConfiguration `json:"systemConfiguration,omitempty"` + BaseHTTPResponse + SystemConfiguration SystemConfiguration `json:"systemConfiguration,omitempty"` } + func (b *SystemConfigurationResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } type Templates struct { - EmailComplete string `json:"emailComplete,omitempty"` - EmailSend string `json:"emailSend,omitempty"` - EmailVerify string `json:"emailVerify,omitempty"` - Helpers string `json:"helpers,omitempty"` - Oauth2Authorize string `json:"oauth2Authorize,omitempty"` - Oauth2ChildRegistrationNotAllowed string `json:"oauth2ChildRegistrationNotAllowed,omitempty"` - Oauth2ChildRegistrationNotAllowedComplete string `json:"oauth2ChildRegistrationNotAllowedComplete,omitempty"` - Oauth2CompleteRegistration string `json:"oauth2CompleteRegistration,omitempty"` - Oauth2Device string `json:"oauth2Device,omitempty"` - Oauth2DeviceComplete string `json:"oauth2DeviceComplete,omitempty"` - Oauth2Error string `json:"oauth2Error,omitempty"` - Oauth2Logout string `json:"oauth2Logout,omitempty"` - Oauth2Passwordless string `json:"oauth2Passwordless,omitempty"` - Oauth2Register string `json:"oauth2Register,omitempty"` - Oauth2TwoFactor string `json:"oauth2TwoFactor,omitempty"` - Oauth2Wait string `json:"oauth2Wait,omitempty"` - PasswordChange string `json:"passwordChange,omitempty"` - PasswordComplete string `json:"passwordComplete,omitempty"` - PasswordForgot string `json:"passwordForgot,omitempty"` - PasswordSent string `json:"passwordSent,omitempty"` - RegistrationComplete string `json:"registrationComplete,omitempty"` - RegistrationSend string `json:"registrationSend,omitempty"` - RegistrationVerify string `json:"registrationVerify,omitempty"` + EmailComplete string `json:"emailComplete,omitempty"` + EmailSend string `json:"emailSend,omitempty"` + EmailVerify string `json:"emailVerify,omitempty"` + Helpers string `json:"helpers,omitempty"` + Oauth2Authorize string `json:"oauth2Authorize,omitempty"` + Oauth2ChildRegistrationNotAllowed string `json:"oauth2ChildRegistrationNotAllowed,omitempty"` + Oauth2ChildRegistrationNotAllowedComplete string `json:"oauth2ChildRegistrationNotAllowedComplete,omitempty"` + Oauth2CompleteRegistration string `json:"oauth2CompleteRegistration,omitempty"` + Oauth2Device string `json:"oauth2Device,omitempty"` + Oauth2DeviceComplete string `json:"oauth2DeviceComplete,omitempty"` + Oauth2Error string `json:"oauth2Error,omitempty"` + Oauth2Logout string `json:"oauth2Logout,omitempty"` + Oauth2Passwordless string `json:"oauth2Passwordless,omitempty"` + Oauth2Register string `json:"oauth2Register,omitempty"` + Oauth2TwoFactor string `json:"oauth2TwoFactor,omitempty"` + Oauth2Wait string `json:"oauth2Wait,omitempty"` + PasswordChange string `json:"passwordChange,omitempty"` + PasswordComplete string `json:"passwordComplete,omitempty"` + PasswordForgot string `json:"passwordForgot,omitempty"` + PasswordSent string `json:"passwordSent,omitempty"` + RegistrationComplete string `json:"registrationComplete,omitempty"` + RegistrationSend string `json:"registrationSend,omitempty"` + RegistrationVerify string `json:"registrationVerify,omitempty"` } /** * @author Daniel DeGroff */ type Tenant struct { - Configured bool `json:"configured,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - EmailConfiguration EmailConfiguration `json:"emailConfiguration,omitempty"` - EventConfiguration EventConfiguration `json:"eventConfiguration,omitempty"` - ExternalIdentifierConfiguration ExternalIdentifierConfiguration `json:"externalIdentifierConfiguration,omitempty"` - FailedAuthenticationConfiguration FailedAuthenticationConfiguration `json:"failedAuthenticationConfiguration,omitempty"` - FamilyConfiguration FamilyConfiguration `json:"familyConfiguration,omitempty"` - HttpSessionMaxInactiveInterval int `json:"httpSessionMaxInactiveInterval,omitempty"` - Id string `json:"id,omitempty"` - Issuer string `json:"issuer,omitempty"` - JwtConfiguration JWTConfiguration `json:"jwtConfiguration,omitempty"` - LogoutURL string `json:"logoutURL,omitempty"` - MaximumPasswordAge MaximumPasswordAge `json:"maximumPasswordAge,omitempty"` - MinimumPasswordAge MinimumPasswordAge `json:"minimumPasswordAge,omitempty"` - Name string `json:"name,omitempty"` - PasswordEncryptionConfiguration PasswordEncryptionConfiguration `json:"passwordEncryptionConfiguration,omitempty"` - PasswordValidationRules PasswordValidationRules `json:"passwordValidationRules,omitempty"` - ThemeId string `json:"themeId,omitempty"` - UserDeletePolicy TenantUserDeletePolicy `json:"userDeletePolicy,omitempty"` + Configured bool `json:"configured,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + EmailConfiguration EmailConfiguration `json:"emailConfiguration,omitempty"` + EventConfiguration EventConfiguration `json:"eventConfiguration,omitempty"` + ExternalIdentifierConfiguration ExternalIdentifierConfiguration `json:"externalIdentifierConfiguration,omitempty"` + FailedAuthenticationConfiguration FailedAuthenticationConfiguration `json:"failedAuthenticationConfiguration,omitempty"` + FamilyConfiguration FamilyConfiguration `json:"familyConfiguration,omitempty"` + HttpSessionMaxInactiveInterval int `json:"httpSessionMaxInactiveInterval,omitempty"` + Id string `json:"id,omitempty"` + Issuer string `json:"issuer,omitempty"` + JwtConfiguration JWTConfiguration `json:"jwtConfiguration,omitempty"` + LogoutURL string `json:"logoutURL,omitempty"` + MaximumPasswordAge MaximumPasswordAge `json:"maximumPasswordAge,omitempty"` + MinimumPasswordAge MinimumPasswordAge `json:"minimumPasswordAge,omitempty"` + Name string `json:"name,omitempty"` + PasswordEncryptionConfiguration PasswordEncryptionConfiguration `json:"passwordEncryptionConfiguration,omitempty"` + PasswordValidationRules PasswordValidationRules `json:"passwordValidationRules,omitempty"` + ThemeId string `json:"themeId,omitempty"` + UserDeletePolicy TenantUserDeletePolicy `json:"userDeletePolicy,omitempty"` } /** @@ -2453,19 +2519,20 @@ type Tenantable struct { * @author Daniel DeGroff */ type TenantRequest struct { - Tenant Tenant `json:"tenant,omitempty"` + Tenant Tenant `json:"tenant,omitempty"` } /** * @author Daniel DeGroff */ type TenantResponse struct { - BaseHTTPResponse - Tenant Tenant `json:"tenant,omitempty"` - Tenants []Tenant `json:"tenants,omitempty"` + BaseHTTPResponse + Tenant Tenant `json:"tenant,omitempty"` + Tenants []Tenant `json:"tenants,omitempty"` } + func (b *TenantResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2474,30 +2541,30 @@ func (b *TenantResponse) SetStatus(status int) { * @author Trevor Smith */ type TenantUserDeletePolicy struct { - Unverified TimeBasedDeletePolicy `json:"unverified,omitempty"` + Unverified TimeBasedDeletePolicy `json:"unverified,omitempty"` } /** * @author Daniel DeGroff */ type TestEvent struct { - BaseEvent - Message string `json:"message,omitempty"` + BaseEvent + Message string `json:"message,omitempty"` } /** * @author Trevor Smith */ type Theme struct { - Data map[string]interface{} `json:"data,omitempty"` - DefaultMessages string `json:"defaultMessages,omitempty"` - Id string `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - LastUpdateInstant int64 `json:"lastUpdateInstant,omitempty"` - LocalizedMessages map[string]string `json:"localizedMessages,omitempty"` - Name string `json:"name,omitempty"` - Stylesheet string `json:"stylesheet,omitempty"` - Templates Templates `json:"templates,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + DefaultMessages string `json:"defaultMessages,omitempty"` + Id string `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + LastUpdateInstant int64 `json:"lastUpdateInstant,omitempty"` + LocalizedMessages map[string]string `json:"localizedMessages,omitempty"` + Name string `json:"name,omitempty"` + Stylesheet string `json:"stylesheet,omitempty"` + Templates Templates `json:"templates,omitempty"` } /** @@ -2506,8 +2573,8 @@ type Theme struct { * @author Trevor Smith */ type ThemeRequest struct { - SourceThemeId string `json:"sourceThemeId,omitempty"` - Theme Theme `json:"theme,omitempty"` + SourceThemeId string `json:"sourceThemeId,omitempty"` + Theme Theme `json:"theme,omitempty"` } /** @@ -2516,12 +2583,13 @@ type ThemeRequest struct { * @author Trevor Smith */ type ThemeResponse struct { - BaseHTTPResponse - Theme Theme `json:"theme,omitempty"` - Themes []Theme `json:"themes,omitempty"` + BaseHTTPResponse + Theme Theme `json:"theme,omitempty"` + Themes []Theme `json:"themes,omitempty"` } + func (b *ThemeResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2530,8 +2598,8 @@ func (b *ThemeResponse) SetStatus(status int) { * @author Trevor Smith */ type TimeBasedDeletePolicy struct { - Enableable - NumberOfDaysToRetain int `json:"numberOfDaysToRetain,omitempty"` + Enableable + NumberOfDaysToRetain int `json:"numberOfDaysToRetain,omitempty"` } /** @@ -2546,15 +2614,16 @@ type TimeBasedDeletePolicy struct { * @author Daniel DeGroff */ type TokenType string + const ( - TokenType_Bearer TokenType = "Bearer" - TokenType_MAC TokenType = "MAC" + TokenType_Bearer TokenType = "Bearer" + TokenType_MAC TokenType = "MAC" ) type Totals struct { - Logins int64 `json:"logins,omitempty"` - Registrations int64 `json:"registrations,omitempty"` - TotalRegistrations int64 `json:"totalRegistrations,omitempty"` + Logins int64 `json:"logins,omitempty"` + Registrations int64 `json:"registrations,omitempty"` + TotalRegistrations int64 `json:"totalRegistrations,omitempty"` } /** @@ -2563,13 +2632,14 @@ type Totals struct { * @author Brian Pontarelli */ type TotalsReportResponse struct { - BaseHTTPResponse - ApplicationTotals map[string]Totals `json:"applicationTotals,omitempty"` - GlobalRegistrations int64 `json:"globalRegistrations,omitempty"` - TotalGlobalRegistrations int64 `json:"totalGlobalRegistrations,omitempty"` + BaseHTTPResponse + ApplicationTotals map[string]Totals `json:"applicationTotals,omitempty"` + GlobalRegistrations int64 `json:"globalRegistrations,omitempty"` + TotalGlobalRegistrations int64 `json:"totalGlobalRegistrations,omitempty"` } + func (b *TotalsReportResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2578,12 +2648,13 @@ func (b *TotalsReportResponse) SetStatus(status int) { * @author Brian Pontarelli */ type TransactionType string + const ( - TransactionType_None TransactionType = "None" - TransactionType_Any TransactionType = "Any" - TransactionType_SimpleMajority TransactionType = "SimpleMajority" - TransactionType_SuperMajority TransactionType = "SuperMajority" - TransactionType_AbsoluteMajority TransactionType = "AbsoluteMajority" + TransactionType_None TransactionType = "None" + TransactionType_Any TransactionType = "Any" + TransactionType_SimpleMajority TransactionType = "SimpleMajority" + TransactionType_SuperMajority TransactionType = "SuperMajority" + TransactionType_AbsoluteMajority TransactionType = "AbsoluteMajority" ) /** @@ -2592,22 +2663,22 @@ const ( * @author Daniel DeGroff */ type TwilioConfiguration struct { - Enableable - AccountSID string `json:"accountSID,omitempty"` - AuthToken string `json:"authToken,omitempty"` - FromPhoneNumber string `json:"fromPhoneNumber,omitempty"` - MessagingServiceSid string `json:"messagingServiceSid,omitempty"` - Url string `json:"url,omitempty"` + Enableable + AccountSID string `json:"accountSID,omitempty"` + AuthToken string `json:"authToken,omitempty"` + FromPhoneNumber string `json:"fromPhoneNumber,omitempty"` + MessagingServiceSid string `json:"messagingServiceSid,omitempty"` + Url string `json:"url,omitempty"` } /** * @author Daniel DeGroff */ type TwitterApplicationConfiguration struct { - BaseIdentityProviderApplicationConfiguration - ButtonText string `json:"buttonText,omitempty"` - ConsumerKey string `json:"consumerKey,omitempty"` - ConsumerSecret string `json:"consumerSecret,omitempty"` + BaseIdentityProviderApplicationConfiguration + ButtonText string `json:"buttonText,omitempty"` + ConsumerKey string `json:"consumerKey,omitempty"` + ConsumerSecret string `json:"consumerSecret,omitempty"` } /** @@ -2616,54 +2687,55 @@ type TwitterApplicationConfiguration struct { * @author Daniel DeGroff */ type TwitterIdentityProvider struct { - BaseIdentityProvider - ButtonText string `json:"buttonText,omitempty"` - ConsumerKey string `json:"consumerKey,omitempty"` - ConsumerSecret string `json:"consumerSecret,omitempty"` + BaseIdentityProvider + ButtonText string `json:"buttonText,omitempty"` + ConsumerKey string `json:"consumerKey,omitempty"` + ConsumerSecret string `json:"consumerSecret,omitempty"` } /** * @author Daniel DeGroff */ type TwoFactorDelivery string + const ( - TwoFactorDelivery_None TwoFactorDelivery = "None" - TwoFactorDelivery_TextMessage TwoFactorDelivery = "TextMessage" + TwoFactorDelivery_None TwoFactorDelivery = "None" + TwoFactorDelivery_TextMessage TwoFactorDelivery = "TextMessage" ) /** * @author Daniel DeGroff */ type TwoFactorLoginRequest struct { - BaseLoginRequest - Code string `json:"code,omitempty"` - TrustComputer bool `json:"trustComputer,omitempty"` - TwoFactorId string `json:"twoFactorId,omitempty"` + BaseLoginRequest + Code string `json:"code,omitempty"` + TrustComputer bool `json:"trustComputer,omitempty"` + TwoFactorId string `json:"twoFactorId,omitempty"` } /** * @author Brian Pontarelli */ type TwoFactorRequest struct { - Code string `json:"code,omitempty"` - Delivery TwoFactorDelivery `json:"delivery,omitempty"` - Secret string `json:"secret,omitempty"` - SecretBase32Encoded string `json:"secretBase32Encoded,omitempty"` + Code string `json:"code,omitempty"` + Delivery TwoFactorDelivery `json:"delivery,omitempty"` + Secret string `json:"secret,omitempty"` + SecretBase32Encoded string `json:"secretBase32Encoded,omitempty"` } /** * @author Daniel DeGroff */ type TwoFactorSendRequest struct { - MobilePhone string `json:"mobilePhone,omitempty"` - Secret string `json:"secret,omitempty"` - UserId string `json:"userId,omitempty"` + MobilePhone string `json:"mobilePhone,omitempty"` + Secret string `json:"secret,omitempty"` + UserId string `json:"userId,omitempty"` } type UIConfiguration struct { - HeaderColor string `json:"headerColor,omitempty"` - LogoURL string `json:"logoURL,omitempty"` - MenuFontColor string `json:"menuFontColor,omitempty"` + HeaderColor string `json:"headerColor,omitempty"` + LogoURL string `json:"logoURL,omitempty"` + MenuFontColor string `json:"menuFontColor,omitempty"` } /** @@ -2673,32 +2745,32 @@ type UIConfiguration struct { * @author Seth Musselman */ type User struct { - SecureIdentity - Active bool `json:"active,omitempty"` - BirthDate int64 `json:"birthDate,omitempty"` - CleanSpeakId string `json:"cleanSpeakId,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - Email string `json:"email,omitempty"` - Expiry int64 `json:"expiry,omitempty"` - FirstName string `json:"firstName,omitempty"` - FullName string `json:"fullName,omitempty"` - ImageUrl string `json:"imageUrl,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - LastLoginInstant int64 `json:"lastLoginInstant,omitempty"` - LastName string `json:"lastName,omitempty"` - Memberships []GroupMember `json:"memberships,omitempty"` - MiddleName string `json:"middleName,omitempty"` - MobilePhone string `json:"mobilePhone,omitempty"` - ParentEmail string `json:"parentEmail,omitempty"` - PreferredLanguages []string `json:"preferredLanguages,omitempty"` - Registrations []UserRegistration `json:"registrations,omitempty"` - TenantId string `json:"tenantId,omitempty"` - Timezone string `json:"timezone,omitempty"` - TwoFactorDelivery TwoFactorDelivery `json:"twoFactorDelivery,omitempty"` - TwoFactorEnabled bool `json:"twoFactorEnabled,omitempty"` - TwoFactorSecret string `json:"twoFactorSecret,omitempty"` - Username string `json:"username,omitempty"` - UsernameStatus ContentStatus `json:"usernameStatus,omitempty"` + SecureIdentity + Active bool `json:"active,omitempty"` + BirthDate int64 `json:"birthDate,omitempty"` + CleanSpeakId string `json:"cleanSpeakId,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + Email string `json:"email,omitempty"` + Expiry int64 `json:"expiry,omitempty"` + FirstName string `json:"firstName,omitempty"` + FullName string `json:"fullName,omitempty"` + ImageUrl string `json:"imageUrl,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + LastLoginInstant int64 `json:"lastLoginInstant,omitempty"` + LastName string `json:"lastName,omitempty"` + Memberships []GroupMember `json:"memberships,omitempty"` + MiddleName string `json:"middleName,omitempty"` + MobilePhone string `json:"mobilePhone,omitempty"` + ParentEmail string `json:"parentEmail,omitempty"` + PreferredLanguages []string `json:"preferredLanguages,omitempty"` + Registrations []UserRegistration `json:"registrations,omitempty"` + TenantId string `json:"tenantId,omitempty"` + Timezone string `json:"timezone,omitempty"` + TwoFactorDelivery TwoFactorDelivery `json:"twoFactorDelivery,omitempty"` + TwoFactorEnabled bool `json:"twoFactorEnabled,omitempty"` + TwoFactorSecret string `json:"twoFactorSecret,omitempty"` + Username string `json:"username,omitempty"` + UsernameStatus ContentStatus `json:"usernameStatus,omitempty"` } /** @@ -2707,22 +2779,22 @@ type User struct { * @author Brian Pontarelli */ type UserAction struct { - Active bool `json:"active,omitempty"` - CancelEmailTemplateId string `json:"cancelEmailTemplateId,omitempty"` - EndEmailTemplateId string `json:"endEmailTemplateId,omitempty"` - Id string `json:"id,omitempty"` - IncludeEmailInEventJSON bool `json:"includeEmailInEventJSON,omitempty"` - LocalizedNames map[string]string `json:"localizedNames,omitempty"` - ModifyEmailTemplateId string `json:"modifyEmailTemplateId,omitempty"` - Name string `json:"name,omitempty"` - Options []UserActionOption `json:"options,omitempty"` - PreventLogin bool `json:"preventLogin,omitempty"` - SendEndEvent bool `json:"sendEndEvent,omitempty"` - StartEmailTemplateId string `json:"startEmailTemplateId,omitempty"` - Temporal bool `json:"temporal,omitempty"` - TransactionType TransactionType `json:"transactionType,omitempty"` - UserEmailingEnabled bool `json:"userEmailingEnabled,omitempty"` - UserNotificationsEnabled bool `json:"userNotificationsEnabled,omitempty"` + Active bool `json:"active,omitempty"` + CancelEmailTemplateId string `json:"cancelEmailTemplateId,omitempty"` + EndEmailTemplateId string `json:"endEmailTemplateId,omitempty"` + Id string `json:"id,omitempty"` + IncludeEmailInEventJSON bool `json:"includeEmailInEventJSON,omitempty"` + LocalizedNames map[string]string `json:"localizedNames,omitempty"` + ModifyEmailTemplateId string `json:"modifyEmailTemplateId,omitempty"` + Name string `json:"name,omitempty"` + Options []UserActionOption `json:"options,omitempty"` + PreventLogin bool `json:"preventLogin,omitempty"` + SendEndEvent bool `json:"sendEndEvent,omitempty"` + StartEmailTemplateId string `json:"startEmailTemplateId,omitempty"` + Temporal bool `json:"temporal,omitempty"` + TransactionType TransactionType `json:"transactionType,omitempty"` + UserEmailingEnabled bool `json:"userEmailingEnabled,omitempty"` + UserNotificationsEnabled bool `json:"userNotificationsEnabled,omitempty"` } /** @@ -2731,25 +2803,25 @@ type UserAction struct { * @author Brian Pontarelli */ type UserActionEvent struct { - BaseEvent - Action string `json:"action,omitempty"` - ActioneeUserId string `json:"actioneeUserId,omitempty"` - ActionerUserId string `json:"actionerUserId,omitempty"` - ActionId string `json:"actionId,omitempty"` - ApplicationIds []string `json:"applicationIds,omitempty"` - Comment string `json:"comment,omitempty"` - Email Email `json:"email,omitempty"` - EmailedUser bool `json:"emailedUser,omitempty"` - Expiry int64 `json:"expiry,omitempty"` - LocalizedAction string `json:"localizedAction,omitempty"` - LocalizedDuration string `json:"localizedDuration,omitempty"` - LocalizedOption string `json:"localizedOption,omitempty"` - LocalizedReason string `json:"localizedReason,omitempty"` - NotifyUser bool `json:"notifyUser,omitempty"` - Option string `json:"option,omitempty"` - Phase UserActionPhase `json:"phase,omitempty"` - Reason string `json:"reason,omitempty"` - ReasonCode string `json:"reasonCode,omitempty"` + BaseEvent + Action string `json:"action,omitempty"` + ActioneeUserId string `json:"actioneeUserId,omitempty"` + ActionerUserId string `json:"actionerUserId,omitempty"` + ActionId string `json:"actionId,omitempty"` + ApplicationIds []string `json:"applicationIds,omitempty"` + Comment string `json:"comment,omitempty"` + Email Email `json:"email,omitempty"` + EmailedUser bool `json:"emailedUser,omitempty"` + Expiry int64 `json:"expiry,omitempty"` + LocalizedAction string `json:"localizedAction,omitempty"` + LocalizedDuration string `json:"localizedDuration,omitempty"` + LocalizedOption string `json:"localizedOption,omitempty"` + LocalizedReason string `json:"localizedReason,omitempty"` + NotifyUser bool `json:"notifyUser,omitempty"` + Option string `json:"option,omitempty"` + Phase UserActionPhase `json:"phase,omitempty"` + Reason string `json:"reason,omitempty"` + ReasonCode string `json:"reasonCode,omitempty"` } /** @@ -2758,25 +2830,25 @@ type UserActionEvent struct { * @author Brian Pontarelli */ type UserActionLog struct { - ActioneeUserId string `json:"actioneeUserId,omitempty"` - ActionerUserId string `json:"actionerUserId,omitempty"` - ApplicationIds []string `json:"applicationIds,omitempty"` - Comment string `json:"comment,omitempty"` - CreateInstant int64 `json:"createInstant,omitempty"` - EmailUserOnEnd bool `json:"emailUserOnEnd,omitempty"` - EndEventSent bool `json:"endEventSent,omitempty"` - Expiry int64 `json:"expiry,omitempty"` - History LogHistory `json:"history,omitempty"` - Id string `json:"id,omitempty"` - LocalizedName string `json:"localizedName,omitempty"` - LocalizedOption string `json:"localizedOption,omitempty"` - LocalizedReason string `json:"localizedReason,omitempty"` - Name string `json:"name,omitempty"` - NotifyUserOnEnd bool `json:"notifyUserOnEnd,omitempty"` - Option string `json:"option,omitempty"` - Reason string `json:"reason,omitempty"` - ReasonCode string `json:"reasonCode,omitempty"` - UserActionId string `json:"userActionId,omitempty"` + ActioneeUserId string `json:"actioneeUserId,omitempty"` + ActionerUserId string `json:"actionerUserId,omitempty"` + ApplicationIds []string `json:"applicationIds,omitempty"` + Comment string `json:"comment,omitempty"` + CreateInstant int64 `json:"createInstant,omitempty"` + EmailUserOnEnd bool `json:"emailUserOnEnd,omitempty"` + EndEventSent bool `json:"endEventSent,omitempty"` + Expiry int64 `json:"expiry,omitempty"` + History LogHistory `json:"history,omitempty"` + Id string `json:"id,omitempty"` + LocalizedName string `json:"localizedName,omitempty"` + LocalizedOption string `json:"localizedOption,omitempty"` + LocalizedReason string `json:"localizedReason,omitempty"` + Name string `json:"name,omitempty"` + NotifyUserOnEnd bool `json:"notifyUserOnEnd,omitempty"` + Option string `json:"option,omitempty"` + Reason string `json:"reason,omitempty"` + ReasonCode string `json:"reasonCode,omitempty"` + UserActionId string `json:"userActionId,omitempty"` } /** @@ -2785,8 +2857,8 @@ type UserActionLog struct { * @author Brian Pontarelli */ type UserActionOption struct { - LocalizedNames map[string]string `json:"localizedNames,omitempty"` - Name string `json:"name,omitempty"` + LocalizedNames map[string]string `json:"localizedNames,omitempty"` + Name string `json:"name,omitempty"` } /** @@ -2795,11 +2867,12 @@ type UserActionOption struct { * @author Brian Pontarelli */ type UserActionPhase string + const ( - UserActionPhase_Start UserActionPhase = "start" - UserActionPhase_Modify UserActionPhase = "modify" - UserActionPhase_Cancel UserActionPhase = "cancel" - UserActionPhase_End UserActionPhase = "end" + UserActionPhase_Start UserActionPhase = "start" + UserActionPhase_Modify UserActionPhase = "modify" + UserActionPhase_Cancel UserActionPhase = "cancel" + UserActionPhase_End UserActionPhase = "end" ) /** @@ -2808,10 +2881,10 @@ const ( * @author Brian Pontarelli */ type UserActionReason struct { - Code string `json:"code,omitempty"` - Id string `json:"id,omitempty"` - LocalizedTexts map[string]string `json:"localizedTexts,omitempty"` - Text string `json:"text,omitempty"` + Code string `json:"code,omitempty"` + Id string `json:"id,omitempty"` + LocalizedTexts map[string]string `json:"localizedTexts,omitempty"` + Text string `json:"text,omitempty"` } /** @@ -2820,7 +2893,7 @@ type UserActionReason struct { * @author Brian Pontarelli */ type UserActionReasonRequest struct { - UserActionReason UserActionReason `json:"userActionReason,omitempty"` + UserActionReason UserActionReason `json:"userActionReason,omitempty"` } /** @@ -2829,12 +2902,13 @@ type UserActionReasonRequest struct { * @author Brian Pontarelli */ type UserActionReasonResponse struct { - BaseHTTPResponse - UserActionReason UserActionReason `json:"userActionReason,omitempty"` - UserActionReasons []UserActionReason `json:"userActionReasons,omitempty"` + BaseHTTPResponse + UserActionReason UserActionReason `json:"userActionReason,omitempty"` + UserActionReasons []UserActionReason `json:"userActionReasons,omitempty"` } + func (b *UserActionReasonResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2843,7 +2917,7 @@ func (b *UserActionReasonResponse) SetStatus(status int) { * @author Brian Pontarelli */ type UserActionRequest struct { - UserAction UserAction `json:"userAction,omitempty"` + UserAction UserAction `json:"userAction,omitempty"` } /** @@ -2852,12 +2926,13 @@ type UserActionRequest struct { * @author Brian Pontarelli */ type UserActionResponse struct { - BaseHTTPResponse - UserAction UserAction `json:"userAction,omitempty"` - UserActions []UserAction `json:"userActions,omitempty"` + BaseHTTPResponse + UserAction UserAction `json:"userAction,omitempty"` + UserActions []UserAction `json:"userActions,omitempty"` } + func (b *UserActionResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2866,8 +2941,8 @@ func (b *UserActionResponse) SetStatus(status int) { * @author Brian Pontarelli */ type UserBulkCreateEvent struct { - BaseEvent - Users []User `json:"users,omitempty"` + BaseEvent + Users []User `json:"users,omitempty"` } /** @@ -2876,18 +2951,18 @@ type UserBulkCreateEvent struct { * @author Brian Pontarelli */ type UserComment struct { - Comment string `json:"comment,omitempty"` - CommenterId string `json:"commenterId,omitempty"` - CreateInstant int64 `json:"createInstant,omitempty"` - Id string `json:"id,omitempty"` - UserId string `json:"userId,omitempty"` + Comment string `json:"comment,omitempty"` + CommenterId string `json:"commenterId,omitempty"` + CreateInstant int64 `json:"createInstant,omitempty"` + Id string `json:"id,omitempty"` + UserId string `json:"userId,omitempty"` } /** * @author Seth Musselman */ type UserCommentRequest struct { - UserComment UserComment `json:"userComment,omitempty"` + UserComment UserComment `json:"userComment,omitempty"` } /** @@ -2896,12 +2971,13 @@ type UserCommentRequest struct { * @author Seth Musselman */ type UserCommentResponse struct { - BaseHTTPResponse - UserComment UserComment `json:"userComment,omitempty"` - UserComments []UserComment `json:"userComments,omitempty"` + BaseHTTPResponse + UserComment UserComment `json:"userComment,omitempty"` + UserComments []UserComment `json:"userComments,omitempty"` } + func (b *UserCommentResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2910,16 +2986,16 @@ func (b *UserCommentResponse) SetStatus(status int) { * @author Daniel DeGroff */ type UserConsent struct { - Consent Consent `json:"consent,omitempty"` - ConsentId string `json:"consentId,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - GiverUserId string `json:"giverUserId,omitempty"` - Id string `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - LastUpdateInstant int64 `json:"lastUpdateInstant,omitempty"` - Status ConsentStatus `json:"status,omitempty"` - UserId string `json:"userId,omitempty"` - Values []string `json:"values,omitempty"` + Consent Consent `json:"consent,omitempty"` + ConsentId string `json:"consentId,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + GiverUserId string `json:"giverUserId,omitempty"` + Id string `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + LastUpdateInstant int64 `json:"lastUpdateInstant,omitempty"` + Status ConsentStatus `json:"status,omitempty"` + UserId string `json:"userId,omitempty"` + Values []string `json:"values,omitempty"` } /** @@ -2928,7 +3004,7 @@ type UserConsent struct { * @author Daniel DeGroff */ type UserConsentRequest struct { - UserConsent UserConsent `json:"userConsent,omitempty"` + UserConsent UserConsent `json:"userConsent,omitempty"` } /** @@ -2937,12 +3013,13 @@ type UserConsentRequest struct { * @author Daniel DeGroff */ type UserConsentResponse struct { - BaseHTTPResponse - UserConsent UserConsent `json:"userConsent,omitempty"` - UserConsents []UserConsent `json:"userConsents,omitempty"` + BaseHTTPResponse + UserConsent UserConsent `json:"userConsent,omitempty"` + UserConsents []UserConsent `json:"userConsents,omitempty"` } + func (b *UserConsentResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -2951,8 +3028,8 @@ func (b *UserConsentResponse) SetStatus(status int) { * @author Brian Pontarelli */ type UserCreateEvent struct { - BaseEvent - User User `json:"user,omitempty"` + BaseEvent + User User `json:"user,omitempty"` } /** @@ -2961,8 +3038,8 @@ type UserCreateEvent struct { * @author Brian Pontarelli */ type UserDeactivateEvent struct { - BaseEvent - User User `json:"user,omitempty"` + BaseEvent + User User `json:"user,omitempty"` } /** @@ -2972,8 +3049,8 @@ type UserDeactivateEvent struct { * @author Brian Pontarelli */ type UserDeleteEvent struct { - BaseEvent - User User `json:"user,omitempty"` + BaseEvent + User User `json:"user,omitempty"` } /** @@ -2982,11 +3059,11 @@ type UserDeleteEvent struct { * @author Daniel DeGroff */ type UserDeleteRequest struct { - DryRun bool `json:"dryRun,omitempty"` - HardDelete bool `json:"hardDelete,omitempty"` - Query string `json:"query,omitempty"` - QueryString string `json:"queryString,omitempty"` - UserIds []string `json:"userIds,omitempty"` + DryRun bool `json:"dryRun,omitempty"` + HardDelete bool `json:"hardDelete,omitempty"` + Query string `json:"query,omitempty"` + QueryString string `json:"queryString,omitempty"` + UserIds []string `json:"userIds,omitempty"` } /** @@ -2995,14 +3072,15 @@ type UserDeleteRequest struct { * @author Trevor Smith */ type UserDeleteResponse struct { - BaseHTTPResponse - DryRun bool `json:"dryRun,omitempty"` - HardDelete bool `json:"hardDelete,omitempty"` - Total int `json:"total,omitempty"` - UserIds []string `json:"userIds,omitempty"` + BaseHTTPResponse + DryRun bool `json:"dryRun,omitempty"` + HardDelete bool `json:"hardDelete,omitempty"` + Total int `json:"total,omitempty"` + UserIds []string `json:"userIds,omitempty"` } + func (b *UserDeleteResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -3011,8 +3089,8 @@ func (b *UserDeleteResponse) SetStatus(status int) { * @author Trevor Smith */ type UserEmailVerifiedEvent struct { - BaseEvent - User User `json:"user,omitempty"` + BaseEvent + User User `json:"user,omitempty"` } /** @@ -3021,10 +3099,10 @@ type UserEmailVerifiedEvent struct { * @author Daniel DeGroff */ type UserLoginFailedEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - AuthenticationType string `json:"authenticationType,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + AuthenticationType string `json:"authenticationType,omitempty"` + User User `json:"user,omitempty"` } /** @@ -3033,17 +3111,17 @@ type UserLoginFailedEvent struct { * @author Daniel DeGroff */ type UserLoginSuccessEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - AuthenticationType string `json:"authenticationType,omitempty"` - IdentityProviderId string `json:"identityProviderId,omitempty"` - IdentityProviderName string `json:"identityProviderName,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + AuthenticationType string `json:"authenticationType,omitempty"` + IdentityProviderId string `json:"identityProviderId,omitempty"` + IdentityProviderName string `json:"identityProviderName,omitempty"` + User User `json:"user,omitempty"` } type UsernameModeration struct { - Enableable - ApplicationId string `json:"applicationId,omitempty"` + Enableable + ApplicationId string `json:"applicationId,omitempty"` } /** @@ -3052,8 +3130,8 @@ type UsernameModeration struct { * @author Brian Pontarelli */ type UserReactivateEvent struct { - BaseEvent - User User `json:"user,omitempty"` + BaseEvent + User User `json:"user,omitempty"` } /** @@ -3062,20 +3140,20 @@ type UserReactivateEvent struct { * @author Brian Pontarelli */ type UserRegistration struct { - ApplicationId string `json:"applicationId,omitempty"` - AuthenticationToken string `json:"authenticationToken,omitempty"` - CleanSpeakId string `json:"cleanSpeakId,omitempty"` - Data map[string]interface{} `json:"data,omitempty"` - Id string `json:"id,omitempty"` - InsertInstant int64 `json:"insertInstant,omitempty"` - LastLoginInstant int64 `json:"lastLoginInstant,omitempty"` - PreferredLanguages []string `json:"preferredLanguages,omitempty"` - Roles []string `json:"roles,omitempty"` - Timezone string `json:"timezone,omitempty"` - Tokens map[string]string `json:"tokens,omitempty"` - Username string `json:"username,omitempty"` - UsernameStatus ContentStatus `json:"usernameStatus,omitempty"` - Verified bool `json:"verified,omitempty"` + ApplicationId string `json:"applicationId,omitempty"` + AuthenticationToken string `json:"authenticationToken,omitempty"` + CleanSpeakId string `json:"cleanSpeakId,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` + Id string `json:"id,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + LastLoginInstant int64 `json:"lastLoginInstant,omitempty"` + PreferredLanguages []string `json:"preferredLanguages,omitempty"` + Roles []string `json:"roles,omitempty"` + Timezone string `json:"timezone,omitempty"` + Tokens map[string]string `json:"tokens,omitempty"` + Username string `json:"username,omitempty"` + UsernameStatus ContentStatus `json:"usernameStatus,omitempty"` + Verified bool `json:"verified,omitempty"` } /** @@ -3084,10 +3162,10 @@ type UserRegistration struct { * @author Daniel DeGroff */ type UserRegistrationCreateEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - Registration UserRegistration `json:"registration,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + Registration UserRegistration `json:"registration,omitempty"` + User User `json:"user,omitempty"` } /** @@ -3096,10 +3174,10 @@ type UserRegistrationCreateEvent struct { * @author Daniel DeGroff */ type UserRegistrationDeleteEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - Registration UserRegistration `json:"registration,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + Registration UserRegistration `json:"registration,omitempty"` + User User `json:"user,omitempty"` } /** @@ -3108,11 +3186,11 @@ type UserRegistrationDeleteEvent struct { * @author Daniel DeGroff */ type UserRegistrationUpdateEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - Original UserRegistration `json:"original,omitempty"` - Registration UserRegistration `json:"registration,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + Original UserRegistration `json:"original,omitempty"` + Registration UserRegistration `json:"registration,omitempty"` + User User `json:"user,omitempty"` } /** @@ -3121,10 +3199,10 @@ type UserRegistrationUpdateEvent struct { * @author Trevor Smith */ type UserRegistrationVerifiedEvent struct { - BaseEvent - ApplicationId string `json:"applicationId,omitempty"` - Registration UserRegistration `json:"registration,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + ApplicationId string `json:"applicationId,omitempty"` + Registration UserRegistration `json:"registration,omitempty"` + User User `json:"user,omitempty"` } /** @@ -3133,9 +3211,9 @@ type UserRegistrationVerifiedEvent struct { * @author Brian Pontarelli */ type UserRequest struct { - SendSetPasswordEmail bool `json:"sendSetPasswordEmail,omitempty"` - SkipVerification bool `json:"skipVerification,omitempty"` - User User `json:"user,omitempty"` + SendSetPasswordEmail bool `json:"sendSetPasswordEmail,omitempty"` + SkipVerification bool `json:"skipVerification,omitempty"` + User User `json:"user,omitempty"` } /** @@ -3144,11 +3222,12 @@ type UserRequest struct { * @author Brian Pontarelli */ type UserResponse struct { - BaseHTTPResponse - User User `json:"user,omitempty"` + BaseHTTPResponse + User User `json:"user,omitempty"` } + func (b *UserResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -3157,24 +3236,25 @@ func (b *UserResponse) SetStatus(status int) { * @author Brian Pontarelli */ type UserSearchCriteria struct { - BaseSearchCriteria - Email string `json:"email,omitempty"` - FullName string `json:"fullName,omitempty"` - Id string `json:"id,omitempty"` - Ids []string `json:"ids,omitempty"` - Query string `json:"query,omitempty"` - QueryString string `json:"queryString,omitempty"` - SortFields []SortField `json:"sortFields,omitempty"` - Username string `json:"username,omitempty"` + BaseSearchCriteria + Email string `json:"email,omitempty"` + FullName string `json:"fullName,omitempty"` + Id string `json:"id,omitempty"` + Ids []string `json:"ids,omitempty"` + Query string `json:"query,omitempty"` + QueryString string `json:"queryString,omitempty"` + SortFields []SortField `json:"sortFields,omitempty"` + Username string `json:"username,omitempty"` } /** * @author Daniel DeGroff */ type UserState string + const ( - UserState_Authenticated UserState = "Authenticated" - UserState_AuthenticatedNotRegistered UserState = "AuthenticatedNotRegistered" + UserState_Authenticated UserState = "Authenticated" + UserState_AuthenticatedNotRegistered UserState = "AuthenticatedNotRegistered" ) /** @@ -3183,42 +3263,45 @@ const ( * @author Brian Pontarelli */ type UserUpdateEvent struct { - BaseEvent - Original User `json:"original,omitempty"` - User User `json:"user,omitempty"` + BaseEvent + Original User `json:"original,omitempty"` + User User `json:"user,omitempty"` } /** * @author Daniel DeGroff */ type ValidateResponse struct { - BaseHTTPResponse - Jwt JWT `json:"jwt,omitempty"` + BaseHTTPResponse + Jwt JWT `json:"jwt,omitempty"` } + func (b *ValidateResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type VerifyEmailResponse struct { - BaseHTTPResponse - VerificationId string `json:"verificationId,omitempty"` + BaseHTTPResponse + VerificationId string `json:"verificationId,omitempty"` } + func (b *VerifyEmailResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** * @author Daniel DeGroff */ type VerifyRegistrationResponse struct { - BaseHTTPResponse - VerificationId string `json:"verificationId,omitempty"` + BaseHTTPResponse + VerificationId string `json:"verificationId,omitempty"` } + func (b *VerifyRegistrationResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } /** @@ -3227,22 +3310,22 @@ func (b *VerifyRegistrationResponse) SetStatus(status int) { * @author Brian Pontarelli */ type Webhook struct { - ApplicationIds []string `json:"applicationIds,omitempty"` - ConnectTimeout int `json:"connectTimeout,omitempty"` - Data WebhookData `json:"data,omitempty"` - Description string `json:"description,omitempty"` - Global bool `json:"global,omitempty"` - Headers map[string]string `json:"headers,omitempty"` - HttpAuthenticationPassword string `json:"httpAuthenticationPassword,omitempty"` - HttpAuthenticationUsername string `json:"httpAuthenticationUsername,omitempty"` - Id string `json:"id,omitempty"` - ReadTimeout int `json:"readTimeout,omitempty"` - SslCertificate string `json:"sslCertificate,omitempty"` - Url string `json:"url,omitempty"` + ApplicationIds []string `json:"applicationIds,omitempty"` + ConnectTimeout int `json:"connectTimeout,omitempty"` + Data WebhookData `json:"data,omitempty"` + Description string `json:"description,omitempty"` + Global bool `json:"global,omitempty"` + Headers map[string]string `json:"headers,omitempty"` + HttpAuthenticationPassword string `json:"httpAuthenticationPassword,omitempty"` + HttpAuthenticationUsername string `json:"httpAuthenticationUsername,omitempty"` + Id string `json:"id,omitempty"` + ReadTimeout int `json:"readTimeout,omitempty"` + SslCertificate string `json:"sslCertificate,omitempty"` + Url string `json:"url,omitempty"` } type WebhookData struct { - EventsEnabled map[EventType]bool `json:"eventsEnabled,omitempty"` + EventsEnabled map[EventType]bool `json:"eventsEnabled,omitempty"` } /** @@ -3251,7 +3334,7 @@ type WebhookData struct { * @author Brian Pontarelli */ type WebhookRequest struct { - Webhook Webhook `json:"webhook,omitempty"` + Webhook Webhook `json:"webhook,omitempty"` } /** @@ -3260,11 +3343,11 @@ type WebhookRequest struct { * @author Brian Pontarelli */ type WebhookResponse struct { - BaseHTTPResponse - Webhook Webhook `json:"webhook,omitempty"` - Webhooks []Webhook `json:"webhooks,omitempty"` + BaseHTTPResponse + Webhook Webhook `json:"webhook,omitempty"` + Webhooks []Webhook `json:"webhooks,omitempty"` } + func (b *WebhookResponse) SetStatus(status int) { - b.StatusCode = status + b.StatusCode = status } -