Reference documentation and code samples for the Google Cloud Commerce Producer V1beta Client class Usage.
The price for the usage SKUs.
Generated from protobuf message google.cloud.commerceproducer.v1beta.PrivateOffer.SingleProductOffer.PriceModel.Usage
Namespace
Google \ Cloud \ CommerceProducer \ V1beta \ PrivateOffer \ SingleProductOffer \ PriceModelMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ default_discount_percent |
Google\Type\Decimal
Optional. The default discount percent for usage SKUs. An unset default discount percent is equivalent to 0 (no discount). Must be between 0 and 100 inclusive, with precision up to 2 decimal places. If this field is set, then the allowed pattern for 'value' is |
↳ sku_discounts |
array<SkuDiscount>
Optional. The discounts for the specific SKUs that override the |
getDefaultDiscountPercent
Optional. The default discount percent for usage SKUs.
An unset default discount percent is equivalent to 0 (no discount).
Must be between 0 and 100 inclusive, with precision up to 2 decimal
places. If this field is set, then the allowed pattern for 'value'
is ^([0-9]{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)$.
Examples of valid values: "0", "100.0", "12.34", "40.0".
Example of invalid values: ".3", "-1", "100.1", "12.345", "+12", "".
| Returns | |
|---|---|
| Type | Description |
Google\Type\Decimal|null |
|
hasDefaultDiscountPercent
clearDefaultDiscountPercent
setDefaultDiscountPercent
Optional. The default discount percent for usage SKUs.
An unset default discount percent is equivalent to 0 (no discount).
Must be between 0 and 100 inclusive, with precision up to 2 decimal
places. If this field is set, then the allowed pattern for 'value'
is ^([0-9]{1,2}(\\.\\d{1,2})?|100(\\.0{1,2})?)$.
Examples of valid values: "0", "100.0", "12.34", "40.0".
Example of invalid values: ".3", "-1", "100.1", "12.345", "+12", "".
| Parameter | |
|---|---|
| Name | Description |
var |
Google\Type\Decimal
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getSkuDiscounts
Optional. The discounts for the specific SKUs that override the
default_discount_percent.
| Returns | |
|---|---|
| Type | Description |
Google\Protobuf\RepeatedField<SkuDiscount> |
|
setSkuDiscounts
Optional. The discounts for the specific SKUs that override the
default_discount_percent.
| Parameter | |
|---|---|
| Name | Description |
var |
array<SkuDiscount>
|
| Returns | |
|---|---|
| Type | Description |
$this |
|