Skip to content

Commit

Permalink
fix AuthorizationServerPolicy definition
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanapellanes-okta committed Nov 12, 2024
1 parent 3171912 commit 9180fdd
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ docs/AuthorizationServerPolicyRuleActions.md
docs/AuthorizationServerPolicyRuleConditions.md
docs/AuthorizationServerPolicyRuleGroupCondition.md
docs/AuthorizationServerPolicyRuleUserCondition.md
docs/AuthorizationServerPolicyStatus.md
docs/AuthorizationServerRulesApi.md
docs/AuthorizationServerScopesApi.md
docs/AutoAssignAdminAppSetting.md
Expand Down Expand Up @@ -1520,6 +1521,7 @@ src/Okta.Sdk/Model/AuthorizationServerPolicyRuleActions.cs
src/Okta.Sdk/Model/AuthorizationServerPolicyRuleConditions.cs
src/Okta.Sdk/Model/AuthorizationServerPolicyRuleGroupCondition.cs
src/Okta.Sdk/Model/AuthorizationServerPolicyRuleUserCondition.cs
src/Okta.Sdk/Model/AuthorizationServerPolicyStatus.cs
src/Okta.Sdk/Model/AutoAssignAdminAppSetting.cs
src/Okta.Sdk/Model/AutoLoginApplication.cs
src/Okta.Sdk/Model/AutoLoginApplicationSettings.cs
Expand Down
1 change: 1 addition & 0 deletions API_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ Class | Method | HTTP request | Description
- [Model.AuthorizationServerPolicyRuleConditions](docs/AuthorizationServerPolicyRuleConditions.md)
- [Model.AuthorizationServerPolicyRuleGroupCondition](docs/AuthorizationServerPolicyRuleGroupCondition.md)
- [Model.AuthorizationServerPolicyRuleUserCondition](docs/AuthorizationServerPolicyRuleUserCondition.md)
- [Model.AuthorizationServerPolicyStatus](docs/AuthorizationServerPolicyStatus.md)
- [Model.AutoAssignAdminAppSetting](docs/AutoAssignAdminAppSetting.md)
- [Model.AutoLoginApplication](docs/AutoLoginApplication.md)
- [Model.AutoLoginApplicationAllOf](docs/AutoLoginApplicationAllOf.md)
Expand Down
10 changes: 10 additions & 0 deletions docs/AuthorizationServerPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | ID of the Policy | [optional]
**Type** | **string** | Indicates that the Policy is an authorization server Policy | [optional]
**Name** | **string** | Name of the Policy | [optional]
**Conditions** | [**AuthorizationServerPolicyConditions**](AuthorizationServerPolicyConditions.md) | | [optional]
**Description** | **string** | Description of the Policy | [optional]
**Priority** | **int** | Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server | [optional]
**Status** | **AuthorizationServerPolicyStatus** | | [optional]
**System** | **bool** | Specifies whether Okta created this Policy | [optional]
**Created** | **DateTimeOffset** | Timestamp when the Policy was created | [optional] [readonly]
**LastUpdated** | **DateTimeOffset** | Timestamp when the Policy was last updated | [optional] [readonly]
**Links** | [**LinksSelfAndLifecycle**](LinksSelfAndLifecycle.md) | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

47 changes: 47 additions & 0 deletions openapi3/management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32849,6 +32849,12 @@ components:
- none
- recovery
- sso
AuthorizationServerPolicyStatus:
description: The allowed statuses for the AurhorizationServerPolicy
type: string
enum:
- ACTIVE
- INACTIVE
ApiToken:
title: API Token
description: An API token for an Okta User. This token is NOT scoped any further and can be used for any API the user has permissions to call.
Expand Down Expand Up @@ -34301,8 +34307,49 @@ components:
allOf:
- type: object
properties:
id:
type: string
description: ID of the Policy
type:
type: string
description: Indicates that the Policy is an authorization server Policy
enum:
- OAUTH_AUTHORIZATION_POLICY
name:
type: string
description: Name of the Policy
conditions:
$ref: '#/components/schemas/AuthorizationServerPolicyConditions'
description:
type: string
description: Description of the Policy
priority:
type: integer
description: Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server
status:
$ref: '#/components/schemas/AuthorizationServerPolicyStatus'
system:
type: boolean
description: Specifies whether Okta created this Policy
created:
type: string
format: date-time
readOnly: true
description: Timestamp when the Policy was created
lastUpdated:
type: string
format: date-time
readOnly: true
description: Timestamp when the Policy was last updated
_links:
allOf:
- $ref: '#/components/schemas/LinksSelfAndLifecycle'
- type: object
properties:
rules:
allOf:
- description: Link to the authorization server policy's rules
- $ref: '#/components/schemas/HrefObject'
AuthorizationServerPolicyConditions:
type: object
properties:
Expand Down
206 changes: 206 additions & 0 deletions src/Okta.Sdk/Model/AuthorizationServerPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,129 @@ namespace Okta.Sdk.Model

public partial class AuthorizationServerPolicy : IEquatable<AuthorizationServerPolicy>
{
/// <summary>
/// Indicates that the Policy is an authorization server Policy
/// </summary>
/// <value>Indicates that the Policy is an authorization server Policy</value>
[JsonConverter(typeof(StringEnumSerializingConverter))]
public sealed class TypeEnum : StringEnum
{
/// <summary>
/// StringEnum OAUTHAUTHORIZATIONPOLICY for value: OAUTH_AUTHORIZATION_POLICY
/// </summary>

public static TypeEnum OAUTHAUTHORIZATIONPOLICY = new TypeEnum("OAUTH_AUTHORIZATION_POLICY");


/// <summary>
/// Implicit operator declaration to accept and convert a string value as a <see cref="TypeEnum"/>
/// </summary>
/// <param name="value">The value to use</param>
public static implicit operator TypeEnum(string value) => new TypeEnum(value);

/// <summary>
/// Creates a new <see cref="Type"/> instance.
/// </summary>
/// <param name="value">The value to use.</param>
public TypeEnum(string value)
: base(value)
{
}
}


/// <summary>
/// Indicates that the Policy is an authorization server Policy
/// </summary>
/// <value>Indicates that the Policy is an authorization server Policy</value>
[DataMember(Name = "type", EmitDefaultValue = true)]

public TypeEnum Type { get; set; }

/// <summary>
/// Gets or Sets Status
/// </summary>
[DataMember(Name = "status", EmitDefaultValue = true)]

public AuthorizationServerPolicyStatus Status { get; set; }

/// <summary>
/// ID of the Policy
/// </summary>
/// <value>ID of the Policy</value>
[DataMember(Name = "id", EmitDefaultValue = true)]
public string Id { get; set; }

/// <summary>
/// Name of the Policy
/// </summary>
/// <value>Name of the Policy</value>
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }

/// <summary>
/// Gets or Sets Conditions
/// </summary>
[DataMember(Name = "conditions", EmitDefaultValue = true)]
public AuthorizationServerPolicyConditions Conditions { get; set; }

/// <summary>
/// Description of the Policy
/// </summary>
/// <value>Description of the Policy</value>
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }

/// <summary>
/// Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server
/// </summary>
/// <value>Specifies the order in which this Policy is evaluated in relation to the other Policies in a custom authorization server</value>
[DataMember(Name = "priority", EmitDefaultValue = true)]
public int Priority { get; set; }

/// <summary>
/// Specifies whether Okta created this Policy
/// </summary>
/// <value>Specifies whether Okta created this Policy</value>
[DataMember(Name = "system", EmitDefaultValue = true)]
public bool System { get; set; }

/// <summary>
/// Timestamp when the Policy was created
/// </summary>
/// <value>Timestamp when the Policy was created</value>
[DataMember(Name = "created", EmitDefaultValue = true)]
public DateTimeOffset Created { get; private set; }

/// <summary>
/// Returns false as Created should not be serialized given that it's read-only.
/// </summary>
/// <returns>false (boolean)</returns>
public bool ShouldSerializeCreated()
{
return false;
}
/// <summary>
/// Timestamp when the Policy was last updated
/// </summary>
/// <value>Timestamp when the Policy was last updated</value>
[DataMember(Name = "lastUpdated", EmitDefaultValue = true)]
public DateTimeOffset LastUpdated { get; private set; }

/// <summary>
/// Returns false as LastUpdated should not be serialized given that it's read-only.
/// </summary>
/// <returns>false (boolean)</returns>
public bool ShouldSerializeLastUpdated()
{
return false;
}
/// <summary>
/// Gets or Sets Links
/// </summary>
[DataMember(Name = "_links", EmitDefaultValue = true)]
public LinksSelfAndLifecycle Links { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand All @@ -48,7 +164,17 @@ public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class AuthorizationServerPolicy {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Conditions: ").Append(Conditions).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Priority: ").Append(Priority).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" System: ").Append(System).Append("\n");
sb.Append(" Created: ").Append(Created).Append("\n");
sb.Append(" LastUpdated: ").Append(LastUpdated).Append("\n");
sb.Append(" Links: ").Append(Links).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -84,10 +210,56 @@ public bool Equals(AuthorizationServerPolicy input)
return false;
}
return
(
this.Id == input.Id ||
(this.Id != null &&
this.Id.Equals(input.Id))
) &&
(
this.Type == input.Type ||
this.Type.Equals(input.Type)
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) &&
(
this.Conditions == input.Conditions ||
(this.Conditions != null &&
this.Conditions.Equals(input.Conditions))
) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
) &&
(
this.Priority == input.Priority ||
this.Priority.Equals(input.Priority)
) &&
(
this.Status == input.Status ||
this.Status.Equals(input.Status)
) &&
(
this.System == input.System ||
this.System.Equals(input.System)
) &&
(
this.Created == input.Created ||
(this.Created != null &&
this.Created.Equals(input.Created))
) &&
(
this.LastUpdated == input.LastUpdated ||
(this.LastUpdated != null &&
this.LastUpdated.Equals(input.LastUpdated))
) &&
(
this.Links == input.Links ||
(this.Links != null &&
this.Links.Equals(input.Links))
);
}

Expand All @@ -101,10 +273,44 @@ public override int GetHashCode()
{
int hashCode = 41;

if (this.Id != null)
{
hashCode = (hashCode * 59) + this.Id.GetHashCode();
}
if (this.Type != null)
{
hashCode = (hashCode * 59) + this.Type.GetHashCode();
}
if (this.Name != null)
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
if (this.Conditions != null)
{
hashCode = (hashCode * 59) + this.Conditions.GetHashCode();
}
if (this.Description != null)
{
hashCode = (hashCode * 59) + this.Description.GetHashCode();
}
hashCode = (hashCode * 59) + this.Priority.GetHashCode();
if (this.Status != null)
{
hashCode = (hashCode * 59) + this.Status.GetHashCode();
}
hashCode = (hashCode * 59) + this.System.GetHashCode();
if (this.Created != null)
{
hashCode = (hashCode * 59) + this.Created.GetHashCode();
}
if (this.LastUpdated != null)
{
hashCode = (hashCode * 59) + this.LastUpdated.GetHashCode();
}
if (this.Links != null)
{
hashCode = (hashCode * 59) + this.Links.GetHashCode();
}
return hashCode;
}
}
Expand Down
Loading

0 comments on commit 9180fdd

Please sign in to comment.