Table of Contents

Class CreateAccountSubscriptionRequest

Namespace
Cloudflare.NET.Subscriptions.Models
Assembly
Cloudflare.NET.dll

Request to create a new account subscription.

Creating subscriptions may incur charges. Ensure you have the appropriate billing permissions and understand the pricing of the selected rate plan.

public record CreateAccountSubscriptionRequest : IEquatable<CreateAccountSubscriptionRequest>
Inheritance
CreateAccountSubscriptionRequest
Implements
Inherited Members

Examples

var request = new CreateAccountSubscriptionRequest(
  RatePlan: new RatePlanReference("enterprise_plan_id"),
  Frequency: SubscriptionFrequency.Yearly,
  ComponentValues: new[]
  {
    new SubscriptionComponentValue("page_rules", 100)
  });

var subscription = await client.Subscriptions.CreateAccountSubscriptionAsync(accountId, request);

Constructors

CreateAccountSubscriptionRequest(RatePlanReference, SubscriptionFrequency?, IReadOnlyList<SubscriptionComponentValue>?)

Request to create a new account subscription.

Creating subscriptions may incur charges. Ensure you have the appropriate billing permissions and understand the pricing of the selected rate plan.

public CreateAccountSubscriptionRequest(RatePlanReference RatePlan, SubscriptionFrequency? Frequency = null, IReadOnlyList<SubscriptionComponentValue>? ComponentValues = null)

Parameters

RatePlan RatePlanReference

Reference to the rate plan for this subscription.

Frequency SubscriptionFrequency?

Optional billing frequency (defaults to plan default).

ComponentValues IReadOnlyList<SubscriptionComponentValue>

Optional component values for configurable features.

Examples

var request = new CreateAccountSubscriptionRequest(
  RatePlan: new RatePlanReference("enterprise_plan_id"),
  Frequency: SubscriptionFrequency.Yearly,
  ComponentValues: new[]
  {
    new SubscriptionComponentValue("page_rules", 100)
  });

var subscription = await client.Subscriptions.CreateAccountSubscriptionAsync(accountId, request);

Properties

ComponentValues

Optional component values for configurable features.

[JsonPropertyName("component_values")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<SubscriptionComponentValue>? ComponentValues { get; init; }

Property Value

IReadOnlyList<SubscriptionComponentValue>

Frequency

Optional billing frequency (defaults to plan default).

[JsonPropertyName("frequency")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SubscriptionFrequency? Frequency { get; init; }

Property Value

SubscriptionFrequency?

RatePlan

Reference to the rate plan for this subscription.

[JsonPropertyName("rate_plan")]
public RatePlanReference RatePlan { get; init; }

Property Value

RatePlanReference