Class SubscriptionCreateParameterProperties

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

public final class SubscriptionCreateParameterProperties extends Object implements com.azure.json.JsonSerializable<SubscriptionCreateParameterProperties>
Parameters supplied to the Create subscription operation.
  • Constructor Details

    • SubscriptionCreateParameterProperties

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

    • ownerId

      public String ownerId()
      Get the ownerId property: User (user id path) for whom subscription is being created in form /users/{userId}.
      Returns:
      the ownerId value.
    • withOwnerId

      public SubscriptionCreateParameterProperties withOwnerId(String ownerId)
      Set the ownerId property: User (user id path) for whom subscription is being created in form /users/{userId}.
      Parameters:
      ownerId - the ownerId value to set.
      Returns:
      the SubscriptionCreateParameterProperties object itself.
    • scope

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

      Set the scope property: Scope like /products/{productId} or /apis or /apis/{apiId}.
      Parameters:
      scope - the scope value to set.
      Returns:
      the SubscriptionCreateParameterProperties object itself.
    • displayName

      public String displayName()
      Get the displayName property: Subscription name.
      Returns:
      the displayName value.
    • withDisplayName

      public SubscriptionCreateParameterProperties withDisplayName(String displayName)
      Set the displayName property: Subscription name.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the SubscriptionCreateParameterProperties object itself.
    • primaryKey

      public String primaryKey()
      Get the primaryKey property: Primary subscription key. If not specified during request key will be generated automatically.
      Returns:
      the primaryKey value.
    • withPrimaryKey

      public SubscriptionCreateParameterProperties withPrimaryKey(String primaryKey)
      Set the primaryKey property: Primary subscription key. If not specified during request key will be generated automatically.
      Parameters:
      primaryKey - the primaryKey value to set.
      Returns:
      the SubscriptionCreateParameterProperties object itself.
    • secondaryKey

      public String secondaryKey()
      Get the secondaryKey property: Secondary subscription key. If not specified during request key will be generated automatically.
      Returns:
      the secondaryKey value.
    • withSecondaryKey

      public SubscriptionCreateParameterProperties withSecondaryKey(String secondaryKey)
      Set the secondaryKey property: Secondary subscription key. If not specified during request key will be generated automatically.
      Parameters:
      secondaryKey - the secondaryKey value to set.
      Returns:
      the SubscriptionCreateParameterProperties object itself.
    • state

      public SubscriptionState state()
      Get the state property: Initial subscription state. If no value is specified, subscription is created with Submitted 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: Initial subscription state. If no value is specified, subscription is created with Submitted 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 SubscriptionCreateParameterProperties object itself.
    • allowTracing

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

      public SubscriptionCreateParameterProperties withAllowTracing(Boolean allowTracing)
      Set the allowTracing property: Determines whether tracing can be enabled.
      Parameters:
      allowTracing - the allowTracing value to set.
      Returns:
      the SubscriptionCreateParameterProperties 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<SubscriptionCreateParameterProperties>
      Throws:
      IOException
    • fromJson

      public static SubscriptionCreateParameterProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SubscriptionCreateParameterProperties from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SubscriptionCreateParameterProperties 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 SubscriptionCreateParameterProperties.