diff --git a/pkg/fusionauth/Client.go b/pkg/fusionauth/Client.go index e1a088f..22c1a9e 100644 --- a/pkg/fusionauth/Client.go +++ b/pkg/fusionauth/Client.go @@ -1677,6 +1677,36 @@ func (c *FusionAuthClient) CreateTenantWithContext(ctx context.Context, tenantId return &resp, &errors, err } +// CreateTenantManagerIdentityProviderTypeConfiguration +// Creates a tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +// TenantManagerIdentityProviderTypeConfigurationRequest request The request object that contains all the information used to create the tenant manager identity provider type configuration. +func (c *FusionAuthClient) CreateTenantManagerIdentityProviderTypeConfiguration(_type IdentityProviderType, request TenantManagerIdentityProviderTypeConfigurationRequest) (*TenantManagerIdentityProviderTypeConfigurationResponse, *Errors, error) { + return c.CreateTenantManagerIdentityProviderTypeConfigurationWithContext(context.TODO(), _type, request) +} + +// CreateTenantManagerIdentityProviderTypeConfigurationWithContext +// Creates a tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +// TenantManagerIdentityProviderTypeConfigurationRequest request The request object that contains all the information used to create the tenant manager identity provider type configuration. +func (c *FusionAuthClient) CreateTenantManagerIdentityProviderTypeConfigurationWithContext(ctx context.Context, _type IdentityProviderType, request TenantManagerIdentityProviderTypeConfigurationRequest) (*TenantManagerIdentityProviderTypeConfigurationResponse, *Errors, error) { + var resp TenantManagerIdentityProviderTypeConfigurationResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant-manager/identity-provider"). + WithUriSegment(string(_type)). + WithJSONBody(request). + WithMethod(http.MethodPost). + Do(ctx) + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err +} + // CreateTheme // Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated. // @@ -2770,6 +2800,33 @@ func (c *FusionAuthClient) DeleteTenantAsyncWithContext(ctx context.Context, ten return &resp, &errors, err } +// DeleteTenantManagerIdentityProviderTypeConfiguration +// Deletes the tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +func (c *FusionAuthClient) DeleteTenantManagerIdentityProviderTypeConfiguration(_type IdentityProviderType) (*BaseHTTPResponse, *Errors, error) { + return c.DeleteTenantManagerIdentityProviderTypeConfigurationWithContext(context.TODO(), _type) +} + +// DeleteTenantManagerIdentityProviderTypeConfigurationWithContext +// Deletes the tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +func (c *FusionAuthClient) DeleteTenantManagerIdentityProviderTypeConfigurationWithContext(ctx context.Context, _type IdentityProviderType) (*BaseHTTPResponse, *Errors, error) { + var resp BaseHTTPResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant-manager/identity-provider"). + WithUriSegment(string(_type)). + WithMethod(http.MethodDelete). + Do(ctx) + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err +} + // DeleteTenantWithRequest // Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated // with the tenant and everything under the tenant (applications, users, etc). @@ -4945,6 +5002,36 @@ func (c *FusionAuthClient) PatchTenantWithContext(ctx context.Context, tenantId return &resp, &errors, err } +// PatchTenantManagerIdentityProviderTypeConfiguration +// Patches the tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +// TenantManagerIdentityProviderTypeConfigurationRequest request The request object that contains the new tenant manager identity provider type configuration information. +func (c *FusionAuthClient) PatchTenantManagerIdentityProviderTypeConfiguration(_type IdentityProviderType, request map[string]interface{}) (*TenantManagerIdentityProviderTypeConfigurationResponse, *Errors, error) { + return c.PatchTenantManagerIdentityProviderTypeConfigurationWithContext(context.TODO(), _type, request) +} + +// PatchTenantManagerIdentityProviderTypeConfigurationWithContext +// Patches the tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +// TenantManagerIdentityProviderTypeConfigurationRequest request The request object that contains the new tenant manager identity provider type configuration information. +func (c *FusionAuthClient) PatchTenantManagerIdentityProviderTypeConfigurationWithContext(ctx context.Context, _type IdentityProviderType, request map[string]interface{}) (*TenantManagerIdentityProviderTypeConfigurationResponse, *Errors, error) { + var resp TenantManagerIdentityProviderTypeConfigurationResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant-manager/identity-provider"). + WithUriSegment(string(_type)). + WithJSONBody(request). + WithMethod(http.MethodPatch). + Do(ctx) + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err +} + // PatchTheme // Updates, via PATCH, the theme with the given Id. // @@ -10436,6 +10523,36 @@ func (c *FusionAuthClient) UpdateTenantWithContext(ctx context.Context, tenantId return &resp, &errors, err } +// UpdateTenantManagerIdentityProviderTypeConfiguration +// Updates the tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +// TenantManagerIdentityProviderTypeConfigurationRequest request The request object that contains the updated tenant manager identity provider type configuration. +func (c *FusionAuthClient) UpdateTenantManagerIdentityProviderTypeConfiguration(_type IdentityProviderType, request TenantManagerIdentityProviderTypeConfigurationRequest) (*TenantManagerIdentityProviderTypeConfigurationResponse, *Errors, error) { + return c.UpdateTenantManagerIdentityProviderTypeConfigurationWithContext(context.TODO(), _type, request) +} + +// UpdateTenantManagerIdentityProviderTypeConfigurationWithContext +// Updates the tenant manager identity provider type configuration for the given identity provider type. +// +// IdentityProviderType _type The type of the identity provider. +// TenantManagerIdentityProviderTypeConfigurationRequest request The request object that contains the updated tenant manager identity provider type configuration. +func (c *FusionAuthClient) UpdateTenantManagerIdentityProviderTypeConfigurationWithContext(ctx context.Context, _type IdentityProviderType, request TenantManagerIdentityProviderTypeConfigurationRequest) (*TenantManagerIdentityProviderTypeConfigurationResponse, *Errors, error) { + var resp TenantManagerIdentityProviderTypeConfigurationResponse + var errors Errors + + restClient := c.Start(&resp, &errors) + err := restClient.WithUri("/api/tenant-manager/identity-provider"). + WithUriSegment(string(_type)). + WithJSONBody(request). + WithMethod(http.MethodPut). + Do(ctx) + if restClient.ErrorRef == nil { + return &resp, nil, err + } + return &resp, &errors, err +} + // UpdateTheme // Updates the theme with the given Id. // diff --git a/pkg/fusionauth/Domain.go b/pkg/fusionauth/Domain.go index edb1125..7e2a606 100644 --- a/pkg/fusionauth/Domain.go +++ b/pkg/fusionauth/Domain.go @@ -6200,8 +6200,9 @@ type LoginRecordConfiguration struct { } type TenantManagerConfiguration struct { - AttributeFormId string `json:"attributeFormId,omitempty"` - BrandName string `json:"brandName,omitempty"` + AttributeFormId string `json:"attributeFormId,omitempty"` + BrandName string `json:"brandName,omitempty"` + IdentityProviderTypeConfigurations map[string]TenantManagerIdentityProviderTypeConfiguration `json:"identityProviderTypeConfigurations,omitempty"` } type UIConfiguration struct { @@ -6367,6 +6368,37 @@ type TenantLoginConfiguration struct { RequireAuthentication bool `json:"requireAuthentication"` } +/** + * Configuration object for identity provider types allowed in Tenant Manager + */ +type TenantManagerIdentityProviderTypeConfiguration struct { + Enableable + DefaultAttributeMappings map[string]string `json:"defaultAttributeMappings,omitempty"` + InsertInstant int64 `json:"insertInstant,omitempty"` + LastUpdateInstant int64 `json:"lastUpdateInstant,omitempty"` + LinkingStrategy IdentityProviderLinkingStrategy `json:"linkingStrategy,omitempty"` + Type IdentityProviderType `json:"type,omitempty"` +} + +/** + * The Tenant Manager IdP type configuration request object + */ +type TenantManagerIdentityProviderTypeConfigurationRequest struct { + TypeConfiguration TenantManagerIdentityProviderTypeConfiguration `json:"typeConfiguration,omitempty"` +} + +/** + * The Tenant Manager IdP type configuration response object + */ +type TenantManagerIdentityProviderTypeConfigurationResponse struct { + BaseHTTPResponse + TypeConfiguration TenantManagerIdentityProviderTypeConfiguration `json:"typeConfiguration,omitempty"` +} + +func (b *TenantManagerIdentityProviderTypeConfigurationResponse) SetStatus(status int) { + b.StatusCode = status +} + /** * @author Mikey Sleevi */