# Google Shopping Merchant Accounts V1 Client - Class TermsOfServiceAgreementState (1.4.1)

1.4.1 (latest) 1.4.0 1.3.1 1.2.2 1.1.0 1.0.0 0.10.0 0.9.1 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.3 0.2.0 0.1.0 Reference documentation and code samples for the Google Shopping Merchant Accounts V1 Client class TermsOfServiceAgreementState.

This resource represents the agreement state for a given account and terms of
service kind.

The state is as follows:

- If the business has accepted a terms of service, [`accepted`](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Accepted) will be populated, otherwise it will be empty
- If the business must sign a terms of service, [`required`](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Required) will be populated, otherwise it will be empty. Note that both `required` and `accepted` can be present. In this case the `accepted` terms of services will have an expiration date set in the [`valid_until`](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Accepted#_Google_Shopping_Merchant_Accounts_V1_Accepted__getValidUntil__) field. The `required` terms of services need to be accepted before `valid_until` in order for the account to continue having a valid agreement. When accepting new terms of services we expect third-party providers to display the text associated with the given terms of service agreement (the url to the file containing the text is added in the Required message below as [`tos_file_uri`](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Required#_Google_Shopping_Merchant_Accounts_V1_Required__getTosFileUri__)). The actual acceptance of the terms of service is done by calling accept on the [`TermsOfService`](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Accepted#_Google_Shopping_Merchant_Accounts_V1_Accepted__getTermsOfService__) resource. `valid_until` field.

Generated from protobuf message `google.shopping.merchant.accounts.v1.TermsOfServiceAgreementState`

## Namespace

Google \\ Shopping \\ Merchant \\ Accounts \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. The resource name of the terms of service version. Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}` The identifier format is: `{<xref uid="\Google\Shopping\Merchant\Accounts\V1\TermsOfServiceKind">TermsOfServiceKind</xref>}-{country}` For example, an identifier could be: `MERCHANT_CENTER-EU` or `MERCHANT_CENTER-US`. |
| `↳ region_code` | `string` Required. Region code as defined by <https://cldr.unicode.org/>. This is the country the current state applies to. |
| `↳ terms_of_service_kind` | `int` Required. Terms of Service kind associated with the particular version. |
| `↳ accepted` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Accepted` Optional. The accepted terms of service of this kind and for the associated region_code |
| `↳ required` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Required` Optional. The required terms of service |

### getName

Identifier. The resource name of the terms of service version.

Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}`
The identifier format is:
`{<xref uid="\Google\Shopping\Merchant\Accounts\V1\TermsOfServiceKind">TermsOfServiceKind</xref>}-{country}`
For example, an identifier could be: `MERCHANT_CENTER-EU` or
`MERCHANT_CENTER-US`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Identifier. The resource name of the terms of service version.

Format: `accounts/{account}/termsOfServiceAgreementState/{identifier}`
The identifier format is:
`{<xref uid="\Google\Shopping\Merchant\Accounts\V1\TermsOfServiceKind">TermsOfServiceKind</xref>}-{country}`
For example, an identifier could be: `MERCHANT_CENTER-EU` or
`MERCHANT_CENTER-US`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRegionCode

Required. Region code as defined by <https://cldr.unicode.org/>. This is the
country the current state applies to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRegionCode

Required. Region code as defined by <https://cldr.unicode.org/>. This is the
country the current state applies to.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTermsOfServiceKind

Required. Terms of Service kind associated with the particular version.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TermsOfServiceKind](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.TermsOfServiceKind). |

### setTermsOfServiceKind

Required. Terms of Service kind associated with the particular version.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [TermsOfServiceKind](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.TermsOfServiceKind). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAccepted

Optional. The accepted terms of service of this kind and for the associated
region_code

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Accepted|null` |   |

### hasAccepted

### clearAccepted

### setAccepted

Optional. The accepted terms of service of this kind and for the associated
region_code

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Accepted` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRequired

Optional. The required terms of service

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Required|null` |   |

### hasRequired

### clearRequired

### setRequired

Optional. The required terms of service

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest/V1.Required` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |