PoliciesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

BillingManagementClient's

<xref:policies> attribute.

Constructor

PoliciesOperations(*args, **kwargs)

Methods

begin_create_or_update_by_billing_account

Update the policies for a billing account of Enterprise Agreement type.

begin_create_or_update_by_billing_profile

Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

begin_create_or_update_by_customer

Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

begin_create_or_update_by_customer_at_billing_account

Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

get_by_billing_account

Get the policies for a billing account of Enterprise Agreement type.

get_by_billing_profile

Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

get_by_customer

Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

get_by_customer_at_billing_account

Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

get_by_subscription

Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement.

begin_create_or_update_by_billing_account

Update the policies for a billing account of Enterprise Agreement type.

begin_create_or_update_by_billing_account(billing_account_name: str, parameters: _models.BillingAccountPolicy, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.BillingAccountPolicy]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

parameters
Required
BillingAccountPolicy or <xref:JSON> or IO[bytes]

A policy at billing account scope. Is one of the following types: BillingAccountPolicy, JSON, IO[bytes] Required.

Returns

Type Description

An instance of LROPoller that returns BillingAccountPolicy. The BillingAccountPolicy is compatible with MutableMapping

Exceptions

Type Description

begin_create_or_update_by_billing_profile

Updates the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

begin_create_or_update_by_billing_profile(billing_account_name: str, billing_profile_name: str, parameters: _models.BillingProfilePolicy, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.BillingProfilePolicy]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

parameters
Required
BillingProfilePolicy or <xref:JSON> or IO[bytes]

A policy at billing profile scope. Is one of the following types: BillingProfilePolicy, JSON, IO[bytes] Required.

Returns

Type Description

An instance of LROPoller that returns BillingProfilePolicy. The BillingProfilePolicy is compatible with MutableMapping

Exceptions

Type Description

begin_create_or_update_by_customer

Updates the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

begin_create_or_update_by_customer(billing_account_name: str, billing_profile_name: str, customer_name: str, parameters: _models.CustomerPolicy, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.CustomerPolicy]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

customer_name
Required
str

The ID that uniquely identifies a customer. Required.

parameters
Required
CustomerPolicy or <xref:JSON> or IO[bytes]

A policy at customer scope. Is one of the following types: CustomerPolicy, JSON, IO[bytes] Required.

Returns

Type Description

An instance of LROPoller that returns CustomerPolicy. The CustomerPolicy is compatible with MutableMapping

Exceptions

Type Description

begin_create_or_update_by_customer_at_billing_account

Updates the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

begin_create_or_update_by_customer_at_billing_account(billing_account_name: str, customer_name: str, parameters: _models.CustomerPolicy, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.CustomerPolicy]

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

customer_name
Required
str

The ID that uniquely identifies a customer. Required.

parameters
Required
CustomerPolicy or <xref:JSON> or IO[bytes]

A policy at customer scope. Is one of the following types: CustomerPolicy, JSON, IO[bytes] Required.

Returns

Type Description

An instance of LROPoller that returns CustomerPolicy. The CustomerPolicy is compatible with MutableMapping

Exceptions

Type Description

get_by_billing_account

Get the policies for a billing account of Enterprise Agreement type.

get_by_billing_account(billing_account_name: str, **kwargs: Any) -> BillingAccountPolicy

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

Returns

Type Description

BillingAccountPolicy. The BillingAccountPolicy is compatible with MutableMapping

Exceptions

Type Description

get_by_billing_profile

Lists the policies for a billing profile. This operation is supported only for billing accounts with agreement type Microsoft Customer Agreement.

get_by_billing_profile(billing_account_name: str, billing_profile_name: str, **kwargs: Any) -> BillingProfilePolicy

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

Returns

Type Description

BillingProfilePolicy. The BillingProfilePolicy is compatible with MutableMapping

Exceptions

Type Description

get_by_customer

Lists the policies for a customer. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

get_by_customer(billing_account_name: str, billing_profile_name: str, customer_name: str, policy_name: str | ServiceDefinedResourceName, **kwargs: Any) -> CustomerPolicy

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

billing_profile_name
Required
str

The ID that uniquely identifies a billing profile. Required.

customer_name
Required
str

The ID that uniquely identifies a customer. Required.

policy_name
Required

Service-defined resource names such as 'default' which are reserved resource names. "default" Required.

Returns

Type Description

CustomerPolicy. The CustomerPolicy is compatible with MutableMapping

Exceptions

Type Description

get_by_customer_at_billing_account

Lists the policies for a customer at billing account scope. This operation is supported only for billing accounts with agreement type Microsoft Partner Agreement.

get_by_customer_at_billing_account(billing_account_name: str, customer_name: str, **kwargs: Any) -> CustomerPolicy

Parameters

Name Description
billing_account_name
Required
str

The ID that uniquely identifies a billing account. Required.

customer_name
Required
str

The ID that uniquely identifies a customer. Required.

Returns

Type Description

CustomerPolicy. The CustomerPolicy is compatible with MutableMapping

Exceptions

Type Description

get_by_subscription

Lists the policies that are managed by the Billing Admin for the defined subscriptions. This is supported for Microsoft Online Services Program, Microsoft Customer Agreement and Microsoft Partner Agreement.

get_by_subscription(**kwargs: Any) -> SubscriptionPolicy

Returns

Type Description

SubscriptionPolicy. The SubscriptionPolicy is compatible with MutableMapping

Exceptions

Type Description