Class SubscriptionContractProperties

java.lang.Object
com.azure.resourcemanager.apimanagement.fluent.models.SubscriptionContractProperties
All Implemented Interfaces:
com.azure.json.JsonSerializable<SubscriptionContractProperties>

public final class SubscriptionContractProperties extends Object implements com.azure.json.JsonSerializable<SubscriptionContractProperties>
Subscription details.
  • Constructor Details

    • SubscriptionContractProperties

      public SubscriptionContractProperties()
      Creates an instance of SubscriptionContractProperties class.
  • Method Details

    • ownerId

      public String ownerId()
      Get the ownerId property: The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier.
      Returns:
      the ownerId value.
    • withOwnerId

      public SubscriptionContractProperties withOwnerId(String ownerId)
      Set the ownerId property: The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier.
      Parameters:
      ownerId - the ownerId value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • scope

      public String scope()
      Get the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}.
      Returns:
      the scope value.
    • withScope

      public SubscriptionContractProperties withScope(String scope)
      Set the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}.
      Parameters:
      scope - the scope value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • displayName

      public String displayName()
      Get the displayName property: The name of the subscription, or null if the subscription has no name.
      Returns:
      the displayName value.
    • withDisplayName

      public SubscriptionContractProperties withDisplayName(String displayName)
      Set the displayName property: The name of the subscription, or null if the subscription has no name.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • state

      public SubscriptionState state()
      Get the state property: Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
      Returns:
      the state value.
    • withState

      Set the state property: Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
      Parameters:
      state - the state value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • createdDate

      public OffsetDateTime createdDate()
      Get the createdDate property: Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Returns:
      the createdDate value.
    • startDate

      public OffsetDateTime startDate()
      Get the startDate property: Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Returns:
      the startDate value.
    • withStartDate

      public SubscriptionContractProperties withStartDate(OffsetDateTime startDate)
      Set the startDate property: Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Parameters:
      startDate - the startDate value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • expirationDate

      public OffsetDateTime expirationDate()
      Get the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Returns:
      the expirationDate value.
    • withExpirationDate

      public SubscriptionContractProperties withExpirationDate(OffsetDateTime expirationDate)
      Set the expirationDate property: Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Parameters:
      expirationDate - the expirationDate value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • endDate

      public OffsetDateTime endDate()
      Get the endDate property: Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Returns:
      the endDate value.
    • withEndDate

      public SubscriptionContractProperties withEndDate(OffsetDateTime endDate)
      Set the endDate property: Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Parameters:
      endDate - the endDate value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • notificationDate

      public OffsetDateTime notificationDate()
      Get the notificationDate property: Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Returns:
      the notificationDate value.
    • withNotificationDate

      public SubscriptionContractProperties withNotificationDate(OffsetDateTime notificationDate)
      Set the notificationDate property: Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
      Parameters:
      notificationDate - the notificationDate value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • primaryKey

      public String primaryKey()
      Get the primaryKey property: Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
      Returns:
      the primaryKey value.
    • withPrimaryKey

      public SubscriptionContractProperties withPrimaryKey(String primaryKey)
      Set the primaryKey property: Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
      Parameters:
      primaryKey - the primaryKey value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • secondaryKey

      public String secondaryKey()
      Get the secondaryKey property: Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
      Returns:
      the secondaryKey value.
    • withSecondaryKey

      public SubscriptionContractProperties withSecondaryKey(String secondaryKey)
      Set the secondaryKey property: Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
      Parameters:
      secondaryKey - the secondaryKey value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • stateComment

      public String stateComment()
      Get the stateComment property: Optional subscription comment added by an administrator when the state is changed to the 'rejected'.
      Returns:
      the stateComment value.
    • withStateComment

      public SubscriptionContractProperties withStateComment(String stateComment)
      Set the stateComment property: Optional subscription comment added by an administrator when the state is changed to the 'rejected'.
      Parameters:
      stateComment - the stateComment value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • allowTracing

      public Boolean allowTracing()
      Get the allowTracing property: Determines whether tracing is enabled.
      Returns:
      the allowTracing value.
    • withAllowTracing

      public SubscriptionContractProperties withAllowTracing(Boolean allowTracing)
      Set the allowTracing property: Determines whether tracing is enabled.
      Parameters:
      allowTracing - the allowTracing value to set.
      Returns:
      the SubscriptionContractProperties object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<SubscriptionContractProperties>
      Throws:
      IOException
    • fromJson

      public static SubscriptionContractProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SubscriptionContractProperties from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SubscriptionContractProperties if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the SubscriptionContractProperties.