Merge pull request #21 from tiffwchen/update-openapi-files
Updated new commercial marketplace openapi files
This commit is contained in:
Коммит
cfcd034cfa
|
@ -1,384 +0,0 @@
|
|||
{
|
||||
"openapi": "3.0.2",
|
||||
"servers": [
|
||||
{
|
||||
"description": "Marketplace Metering APIs, version 1",
|
||||
"url": "https://marketplaceapi.microsoft.com/api"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": "2018-08-31",
|
||||
"title": "Metering API",
|
||||
"x-ms-code-generation-settings": {
|
||||
"name": "MarketplaceMeteringClient",
|
||||
"header": "MIT",
|
||||
"internalConstructors": true,
|
||||
"useDateTimeOffset": false
|
||||
},
|
||||
"description": "With the commercial marketplace metering service, you can create software as a service (SaaS) and managed application offers which charge according to non-standard units. Before publishing an offer to the commercial marketplace, you define the billing dimensions such as bandwidth, tickets, or emails processed. Customers then pay according to their consumption of these dimensions, with your system informing Microsoft via the commercial marketplace metering service API of billable events."
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"azure_auth": ["user_impersonation"]
|
||||
}
|
||||
],
|
||||
|
||||
"paths": {
|
||||
"/usageEvent": {
|
||||
"post": {
|
||||
"summary": "Posts a single usage event to the marketplace metering service API.",
|
||||
"description": "Posts a single usage event to the marketplace metering service API.",
|
||||
"operationId": "MeteringOperations_PostUsageEvent",
|
||||
"tags": ["MarketplaceMeter"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "api-version",
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ApiVersion"
|
||||
},
|
||||
"required": true,
|
||||
"description": "Version of the API."
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-requestid",
|
||||
"x-ms-client-name": "requestId",
|
||||
"description": "A unique string value for tracking the request from the client, preferably a GUID. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-correlationid",
|
||||
"x-ms-client-name": "correlationId",
|
||||
"description": "A unique string value for operation on the client. This parameter correlates all events from client operation with events on the server side. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UsageEvent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UsageEventOkResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request, missing or invalid data provided or expired."
|
||||
},
|
||||
"403": {
|
||||
"description": "User is unauthorized to make this call."
|
||||
},
|
||||
"409": {
|
||||
"description": "Conflict, when we receive the usage call for the usage resource ID, and effective usage, which already exists. The response will contain additionalInfo field that contains info about the accepted message."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/batchUsageEvent": {
|
||||
"post": {
|
||||
"summary": "Posts a set of usage events to the marketplace metering service API.",
|
||||
"description": "The batch usage event API allows you to emit usage events for more than one purchased entity at once. The batch usage event request references the metering services dimension defined by the publisher when publishing the offer.",
|
||||
"operationId": "MeteringOperations_PostBatchUsageEvent",
|
||||
"tags": ["MarketplaceMeter"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "api-version",
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ApiVersion"
|
||||
},
|
||||
"required": true,
|
||||
"description": "Version of the API."
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-requestid",
|
||||
"x-ms-client-name": "requestId",
|
||||
"description": "A unique string value for tracking the request from the client, preferably a GUID. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-correlationid",
|
||||
"x-ms-client-name": "correlationId",
|
||||
"description": "A unique string value for operation on the client. This parameter correlates all events from client operation with events on the server side. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/BatchUsageEvent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/BatchUsageEventOkResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request, missing or invalid data provided or expired."
|
||||
},
|
||||
"403": {
|
||||
"description": "User is unauthorized to make this call."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"securitySchemes": {
|
||||
"azure_auth": {
|
||||
"type": "oauth2",
|
||||
"description": "Azure Active Directory OAuth2 Flow",
|
||||
"flows": {
|
||||
"clientCredentials": {
|
||||
"tokenUrl": "https://login.microsoftonline.com/{your-app-tenant-id}/oauth2/token"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"ApiVersion": {
|
||||
"type": "string",
|
||||
"description": "The request must send the following parameters as a URL Encoded form; grant_type - client_credentials; resource - 62d94f6c-d599-489b-a797-3e10e42fbe22; client_id - AAD Registered App Client ID; client_secret - AAD Registered App Client Secret",
|
||||
"enum": ["2018-08-31", "2018-09-15"],
|
||||
"default": "2018-08-31"
|
||||
},
|
||||
"UsageEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "subscriptionId property value for SaaS offer subscriptions; resourceUsageId property on the managed application resource for managed application offers. For managed applications, only use one of resourceId or resourceUri."
|
||||
},
|
||||
"resourceUri": {
|
||||
"type": "string",
|
||||
"description": "Resource URI for the managed app. Used with managed applications. Only use resourceUri or resourceId, but never both."
|
||||
},
|
||||
"quantity": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"description": "Number of units consumed"
|
||||
},
|
||||
"dimension": {
|
||||
"type": "string",
|
||||
"description": "Dimension identifier"
|
||||
},
|
||||
"effectiveStartTime": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Time in UTC when the usage event occurred"
|
||||
},
|
||||
"planId": {
|
||||
"type": "string",
|
||||
"description": "Plan associated with the purchased offer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"BatchUsageEvent": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UsageEvent"
|
||||
},
|
||||
"minItems": 1,
|
||||
"maxItems": 25
|
||||
},
|
||||
"UsageEventOkResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"usageEventId": {
|
||||
"description": "Unique identifier associated with the usage event",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status of the operation.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Accepted",
|
||||
"Expired",
|
||||
"Duplicate",
|
||||
"Error",
|
||||
"ResourceNotFound",
|
||||
"ResourceNotAuthorized",
|
||||
"InvalidDimension|BadArgument"
|
||||
],
|
||||
"x-ms-enum": {
|
||||
"name": "UsageEventStatusEnum",
|
||||
"modelAsString": false
|
||||
}
|
||||
},
|
||||
"messageTime": {
|
||||
"description": "Time this message was created in UTC",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"resourceId": {
|
||||
"description": "Identifier of the resource against which usage is emitted",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"resourceUri": {
|
||||
"description": "Identifier of the managed app resource against which usage is emitted",
|
||||
"type": "string"
|
||||
},
|
||||
"quantity": {
|
||||
"description": "Number of units consumed",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"dimension": {
|
||||
"type": "string",
|
||||
"description": "Dimension identifier"
|
||||
},
|
||||
"effectiveStartTime": {
|
||||
"description": "Time in UTC when the usage event occurred",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planId": {
|
||||
"type": "string",
|
||||
"description": "Plan associated with the purchased offer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"BatchUsageEventOkResponse": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UsageEventOkResponse"
|
||||
}
|
||||
},
|
||||
"UsageEventConflictResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"additionalInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"usageEventId": {
|
||||
"description": "Unique identifier associated with the usage event",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"status": {
|
||||
"description": "Accepted|NotProcessed|Expired",
|
||||
"type": "string",
|
||||
"enum": ["Accepted", "NotProcessed", "Expired"]
|
||||
},
|
||||
"messageTime": {
|
||||
"description": "Time this message was created in UTC",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"resourceId": {
|
||||
"description": "Identifier of the resource against which usage is emitted",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"resourceUri": {
|
||||
"description": "Identifier of the managed app resource against which usage is emitted",
|
||||
"type": "string"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"dimension": {
|
||||
"description": "Dimension identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"effectiveStartTime": {
|
||||
"description": "Time in UTC when the usage event occurred",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planId": {
|
||||
"description": "Plan associated with the purchased offer",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"UsageEventBadRequestResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UsageEventBadRequestResponseDetail"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"UsageEventBadRequestResponseDetail": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,384 +0,0 @@
|
|||
{
|
||||
"openapi": "3.0.2",
|
||||
"servers": [
|
||||
{
|
||||
"description": "Marketplace Metering APIs, version 1",
|
||||
"url": "https://marketplaceapi.microsoft.com/api"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": "2018-08-31",
|
||||
"title": "Metering API",
|
||||
"x-ms-code-generation-settings": {
|
||||
"name": "MarketplaceMeteringClient",
|
||||
"header": "MIT",
|
||||
"internalConstructors": true,
|
||||
"useDateTimeOffset": false
|
||||
},
|
||||
"description": "With the commercial marketplace metering service, you can create software as a service (SaaS) and managed application offers which charge according to non-standard units. Before publishing an offer to the commercial marketplace, you define the billing dimensions such as bandwidth, tickets, or emails processed. Customers then pay according to their consumption of these dimensions, with your system informing Microsoft via the commercial marketplace metering service API of billable events."
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"azure_auth": ["user_impersonation"]
|
||||
}
|
||||
],
|
||||
|
||||
"paths": {
|
||||
"/usageEvent": {
|
||||
"post": {
|
||||
"summary": "Posts a single usage event to the marketplace metering service API.",
|
||||
"description": "Posts a single usage event to the marketplace metering service API.",
|
||||
"operationId": "MeteringOperations_PostUsageEvent",
|
||||
"tags": ["MarketplaceMeter"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "api-version",
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ApiVersion"
|
||||
},
|
||||
"required": true,
|
||||
"description": "Version of the API."
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-requestid",
|
||||
"x-ms-client-name": "requestId",
|
||||
"description": "A unique string value for tracking the request from the client, preferably a GUID. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-correlationid",
|
||||
"x-ms-client-name": "correlationId",
|
||||
"description": "A unique string value for operation on the client. This parameter correlates all events from client operation with events on the server side. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UsageEvent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UsageEventOkResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request, missing or invalid data provided or expired."
|
||||
},
|
||||
"403": {
|
||||
"description": "User is unauthorized to make this call."
|
||||
},
|
||||
"409": {
|
||||
"description": "Conflict, when we receive the usage call for the usage resource ID, and effective usage, which already exists. The response will contain additionalInfo field that contains info about the accepted message."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/batchUsageEvent": {
|
||||
"post": {
|
||||
"summary": "Posts a set of usage events to the marketplace metering service API.",
|
||||
"description": "The batch usage event API allows you to emit usage events for more than one purchased entity at once. The batch usage event request references the metering services dimension defined by the publisher when publishing the offer.",
|
||||
"operationId": "MeteringOperations_PostBatchUsageEvent",
|
||||
"tags": ["MarketplaceMeter"],
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "api-version",
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ApiVersion"
|
||||
},
|
||||
"required": true,
|
||||
"description": "Version of the API."
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-requestid",
|
||||
"x-ms-client-name": "requestId",
|
||||
"description": "A unique string value for tracking the request from the client, preferably a GUID. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"in": "header",
|
||||
"name": "x-ms-correlationid",
|
||||
"x-ms-client-name": "correlationId",
|
||||
"description": "A unique string value for operation on the client. This parameter correlates all events from client operation with events on the server side. If this value isn't provided, one will be generated and provided in the response headers.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"required": false
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/BatchUsageEvent"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/BatchUsageEventOkResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad request, missing or invalid data provided or expired."
|
||||
},
|
||||
"403": {
|
||||
"description": "User is unauthorized to make this call."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"securitySchemes": {
|
||||
"azure_auth": {
|
||||
"type": "oauth2",
|
||||
"description": "Azure Active Directory OAuth2 Flow",
|
||||
"flows": {
|
||||
"clientCredentials": {
|
||||
"tokenUrl": "https://login.microsoftonline.com/{your-app-tenant-id}/oauth2/token"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"ApiVersion": {
|
||||
"type": "string",
|
||||
"description": "The request must send the following parameters as a URL Encoded form; grant_type - client_credentials; resource - 62d94f6c-d599-489b-a797-3e10e42fbe22; client_id - AAD Registered App Client ID; client_secret - AAD Registered App Client Secret",
|
||||
"enum": ["2018-08-31", "2018-09-15"],
|
||||
"default": "2018-08-31"
|
||||
},
|
||||
"UsageEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "subscriptionId property value for SaaS offer subscriptions; resourceUsageId property on the managed application resource for managed application offers. For managed applications, only use one of resourceId or resourceUri."
|
||||
},
|
||||
"resourceUri": {
|
||||
"type": "string",
|
||||
"description": "Resource URI for the managed app. Used with managed applications. Only use resourceUri or resourceId, but never both."
|
||||
},
|
||||
"quantity": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"description": "Number of units consumed"
|
||||
},
|
||||
"dimension": {
|
||||
"type": "string",
|
||||
"description": "Dimension identifier"
|
||||
},
|
||||
"effectiveStartTime": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Time in UTC when the usage event occurred"
|
||||
},
|
||||
"planId": {
|
||||
"type": "string",
|
||||
"description": "Plan associated with the purchased offer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"BatchUsageEvent": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UsageEvent"
|
||||
},
|
||||
"minItems": 1,
|
||||
"maxItems": 25
|
||||
},
|
||||
"UsageEventOkResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"usageEventId": {
|
||||
"description": "Unique identifier associated with the usage event",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status of the operation.",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"Accepted",
|
||||
"Expired",
|
||||
"Duplicate",
|
||||
"Error",
|
||||
"ResourceNotFound",
|
||||
"ResourceNotAuthorized",
|
||||
"InvalidDimension|BadArgument"
|
||||
],
|
||||
"x-ms-enum": {
|
||||
"name": "UsageEventStatusEnum",
|
||||
"modelAsString": false
|
||||
}
|
||||
},
|
||||
"messageTime": {
|
||||
"description": "Time this message was created in UTC",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"resourceId": {
|
||||
"description": "Identifier of the resource against which usage is emitted",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"resourceUri": {
|
||||
"description": "Identifier of the managed app resource against which usage is emitted",
|
||||
"type": "string"
|
||||
},
|
||||
"quantity": {
|
||||
"description": "Number of units consumed",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"dimension": {
|
||||
"type": "string",
|
||||
"description": "Dimension identifier"
|
||||
},
|
||||
"effectiveStartTime": {
|
||||
"description": "Time in UTC when the usage event occurred",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planId": {
|
||||
"type": "string",
|
||||
"description": "Plan associated with the purchased offer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"BatchUsageEventOkResponse": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UsageEventOkResponse"
|
||||
}
|
||||
},
|
||||
"UsageEventConflictResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"additionalInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"usageEventId": {
|
||||
"description": "Unique identifier associated with the usage event",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"status": {
|
||||
"description": "Accepted|NotProcessed|Expired",
|
||||
"type": "string",
|
||||
"enum": ["Accepted", "NotProcessed", "Expired"]
|
||||
},
|
||||
"messageTime": {
|
||||
"description": "Time this message was created in UTC",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"resourceId": {
|
||||
"description": "Identifier of the resource against which usage is emitted",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"resourceUri": {
|
||||
"description": "Identifier of the managed app resource against which usage is emitted",
|
||||
"type": "string"
|
||||
},
|
||||
"quantity": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"dimension": {
|
||||
"description": "Dimension identifier",
|
||||
"type": "string"
|
||||
},
|
||||
"effectiveStartTime": {
|
||||
"description": "Time in UTC when the usage event occurred",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"planId": {
|
||||
"description": "Plan associated with the purchased offer",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"UsageEventBadRequestResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/UsageEventBadRequestResponseDetail"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"UsageEventBadRequestResponseDetail": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"target": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,9 +22,11 @@ import com.azure.core.annotation.UnexpectedResponseExceptionType;
|
|||
import com.azure.core.exception.HttpResponseException;
|
||||
import com.azure.core.http.rest.Response;
|
||||
import com.azure.core.http.rest.RestProxy;
|
||||
import com.microsoft.marketplace.meter.models.BatchUsageEvent;
|
||||
import com.microsoft.marketplace.meter.models.BatchUsageEventOkResponse;
|
||||
import com.microsoft.marketplace.meter.models.UsageEvent;
|
||||
import com.microsoft.marketplace.meter.models.UsageEventBadRequestResponseException;
|
||||
import com.microsoft.marketplace.meter.models.UsageEventOkResponse;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
|
@ -54,8 +56,8 @@ public final class MeteringOperations {
|
|||
@ServiceInterface(name = "MeteringAPIMeteringO")
|
||||
private interface MeteringOperationsService {
|
||||
@Post("/usageEvent")
|
||||
@ExpectedResponses({200, 400, 403, 409})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(UsageEventBadRequestResponseException.class)
|
||||
Mono<Response<UsageEventOkResponse>> postUsageEvent(
|
||||
@HostParam("$host") String host,
|
||||
@QueryParam("api-version") String apiVersion,
|
||||
|
@ -64,14 +66,14 @@ public final class MeteringOperations {
|
|||
@BodyParam("application/json") UsageEvent body);
|
||||
|
||||
@Post("/batchUsageEvent")
|
||||
@ExpectedResponses({200, 400, 403})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<List<UsageEventOkResponse>>> postBatchUsageEvent(
|
||||
Mono<Response<BatchUsageEventOkResponse>> postBatchUsageEvent(
|
||||
@HostParam("$host") String host,
|
||||
@QueryParam("api-version") String apiVersion,
|
||||
@HeaderParam("x-ms-requestid") UUID requestId,
|
||||
@HeaderParam("x-ms-correlationid") UUID correlationId,
|
||||
@BodyParam("application/json") List<UsageEvent> body);
|
||||
@BodyParam("application/json") BatchUsageEvent body);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,7 +86,7 @@ public final class MeteringOperations {
|
|||
* client operation with events on the server side. If this value isn't provided, one will be generated and
|
||||
* provided in the response headers.
|
||||
* @throws IllegalArgumentException thrown if parameters fail the validation.
|
||||
* @throws HttpResponseException thrown if the request is rejected by server.
|
||||
* @throws UsageEventBadRequestResponseException thrown if the request is rejected by server.
|
||||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
|
||||
* @return the response.
|
||||
*/
|
||||
|
@ -105,7 +107,7 @@ public final class MeteringOperations {
|
|||
* client operation with events on the server side. If this value isn't provided, one will be generated and
|
||||
* provided in the response headers.
|
||||
* @throws IllegalArgumentException thrown if parameters fail the validation.
|
||||
* @throws HttpResponseException thrown if the request is rejected by server.
|
||||
* @throws UsageEventBadRequestResponseException thrown if the request is rejected by server.
|
||||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
|
||||
* @return the response.
|
||||
*/
|
||||
|
@ -127,7 +129,7 @@ public final class MeteringOperations {
|
|||
* usage event request references the metering services dimension defined by the publisher when publishing the
|
||||
* offer.
|
||||
*
|
||||
* @param body Array of UsageEvent.
|
||||
* @param body The body parameter.
|
||||
* @param requestId A unique string value for tracking the request from the client, preferably a GUID. If this value
|
||||
* isn't provided, one will be generated and provided in the response headers.
|
||||
* @param correlationId A unique string value for operation on the client. This parameter correlates all events from
|
||||
|
@ -136,11 +138,11 @@ public final class MeteringOperations {
|
|||
* @throws IllegalArgumentException thrown if parameters fail the validation.
|
||||
* @throws HttpResponseException thrown if the request is rejected by server.
|
||||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
|
||||
* @return array of UsageEventOkResponse.
|
||||
* @return the response.
|
||||
*/
|
||||
@ServiceMethod(returns = ReturnType.SINGLE)
|
||||
public Mono<Response<List<UsageEventOkResponse>>> postBatchUsageEventWithResponseAsync(
|
||||
List<UsageEvent> body, UUID requestId, UUID correlationId) {
|
||||
public Mono<Response<BatchUsageEventOkResponse>> postBatchUsageEventWithResponseAsync(
|
||||
BatchUsageEvent body, UUID requestId, UUID correlationId) {
|
||||
return service.postBatchUsageEvent(
|
||||
this.client.getHost(), this.client.getApiVersion(), requestId, correlationId, body);
|
||||
}
|
||||
|
@ -150,7 +152,7 @@ public final class MeteringOperations {
|
|||
* usage event request references the metering services dimension defined by the publisher when publishing the
|
||||
* offer.
|
||||
*
|
||||
* @param body Array of UsageEvent.
|
||||
* @param body The body parameter.
|
||||
* @param requestId A unique string value for tracking the request from the client, preferably a GUID. If this value
|
||||
* isn't provided, one will be generated and provided in the response headers.
|
||||
* @param correlationId A unique string value for operation on the client. This parameter correlates all events from
|
||||
|
@ -159,14 +161,14 @@ public final class MeteringOperations {
|
|||
* @throws IllegalArgumentException thrown if parameters fail the validation.
|
||||
* @throws HttpResponseException thrown if the request is rejected by server.
|
||||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
|
||||
* @return array of UsageEventOkResponse.
|
||||
* @return the response.
|
||||
*/
|
||||
@ServiceMethod(returns = ReturnType.SINGLE)
|
||||
public Mono<List<UsageEventOkResponse>> postBatchUsageEventAsync(
|
||||
List<UsageEvent> body, UUID requestId, UUID correlationId) {
|
||||
public Mono<BatchUsageEventOkResponse> postBatchUsageEventAsync(
|
||||
BatchUsageEvent body, UUID requestId, UUID correlationId) {
|
||||
return postBatchUsageEventWithResponseAsync(body, requestId, correlationId)
|
||||
.flatMap(
|
||||
(Response<List<UsageEventOkResponse>> res) -> {
|
||||
(Response<BatchUsageEventOkResponse> res) -> {
|
||||
if (res.getValue() != null) {
|
||||
return Mono.just(res.getValue());
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.meter.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
|
||||
/** The BatchUsageEvent model. */
|
||||
@Fluent
|
||||
public final class BatchUsageEvent {
|
||||
/*
|
||||
* The request property.
|
||||
*/
|
||||
@JsonProperty(value = "request")
|
||||
private List<UsageEvent> request;
|
||||
|
||||
/**
|
||||
* Get the request property: The request property.
|
||||
*
|
||||
* @return the request value.
|
||||
*/
|
||||
public List<UsageEvent> getRequest() {
|
||||
return this.request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the request property: The request property.
|
||||
*
|
||||
* @param request the request value to set.
|
||||
* @return the BatchUsageEvent object itself.
|
||||
*/
|
||||
public BatchUsageEvent setRequest(List<UsageEvent> request) {
|
||||
this.request = request;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.meter.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
|
||||
/** The BatchUsageEventOkResponse model. */
|
||||
@Fluent
|
||||
public final class BatchUsageEventOkResponse {
|
||||
/*
|
||||
* The result property.
|
||||
*/
|
||||
@JsonProperty(value = "result")
|
||||
private List<UsageBatchEventOkMessage> result;
|
||||
|
||||
/*
|
||||
* The count property.
|
||||
*/
|
||||
@JsonProperty(value = "count")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* Get the result property: The result property.
|
||||
*
|
||||
* @return the result value.
|
||||
*/
|
||||
public List<UsageBatchEventOkMessage> getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the result property: The result property.
|
||||
*
|
||||
* @param result the result value to set.
|
||||
* @return the BatchUsageEventOkResponse object itself.
|
||||
*/
|
||||
public BatchUsageEventOkResponse setResult(List<UsageBatchEventOkMessage> result) {
|
||||
this.result = result;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the count property: The count property.
|
||||
*
|
||||
* @return the count value.
|
||||
*/
|
||||
public Integer getCount() {
|
||||
return this.count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the count property: The count property.
|
||||
*
|
||||
* @param count the count value to set.
|
||||
* @return the BatchUsageEventOkResponse object itself.
|
||||
*/
|
||||
public BatchUsageEventOkResponse setCount(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,278 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.meter.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
/** The UsageBatchEventOkMessage model. */
|
||||
@Fluent
|
||||
public final class UsageBatchEventOkMessage {
|
||||
/*
|
||||
* Unique identifier associated with the usage event
|
||||
*/
|
||||
@JsonProperty(value = "usageEventId")
|
||||
private UUID usageEventId;
|
||||
|
||||
/*
|
||||
* Status of the operation.
|
||||
*/
|
||||
@JsonProperty(value = "status")
|
||||
private UsageEventStatusEnum status;
|
||||
|
||||
/*
|
||||
* Time this message was created in UTC
|
||||
*/
|
||||
@JsonProperty(value = "messageTime")
|
||||
private OffsetDateTime messageTime;
|
||||
|
||||
/*
|
||||
* Identifier of the resource against which usage is emitted
|
||||
*/
|
||||
@JsonProperty(value = "resourceId")
|
||||
private UUID resourceId;
|
||||
|
||||
/*
|
||||
* Identifier of the managed app resource against which usage is emitted
|
||||
*/
|
||||
@JsonProperty(value = "resourceUri")
|
||||
private String resourceUri;
|
||||
|
||||
/*
|
||||
* Number of units consumed
|
||||
*/
|
||||
@JsonProperty(value = "quantity")
|
||||
private Double quantity;
|
||||
|
||||
/*
|
||||
* Dimension identifier
|
||||
*/
|
||||
@JsonProperty(value = "dimension")
|
||||
private String dimension;
|
||||
|
||||
/*
|
||||
* Time in UTC when the usage event occurred
|
||||
*/
|
||||
@JsonProperty(value = "effectiveStartTime")
|
||||
private OffsetDateTime effectiveStartTime;
|
||||
|
||||
/*
|
||||
* Plan associated with the purchased offer
|
||||
*/
|
||||
@JsonProperty(value = "planId")
|
||||
private String planId;
|
||||
|
||||
/*
|
||||
* The error property.
|
||||
*/
|
||||
@JsonProperty(value = "error")
|
||||
private UsageEventConflictResponse error;
|
||||
|
||||
/**
|
||||
* Get the usageEventId property: Unique identifier associated with the usage event.
|
||||
*
|
||||
* @return the usageEventId value.
|
||||
*/
|
||||
public UUID getUsageEventId() {
|
||||
return this.usageEventId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the usageEventId property: Unique identifier associated with the usage event.
|
||||
*
|
||||
* @param usageEventId the usageEventId value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setUsageEventId(UUID usageEventId) {
|
||||
this.usageEventId = usageEventId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the status property: Status of the operation.
|
||||
*
|
||||
* @return the status value.
|
||||
*/
|
||||
public UsageEventStatusEnum getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the status property: Status of the operation.
|
||||
*
|
||||
* @param status the status value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setStatus(UsageEventStatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the messageTime property: Time this message was created in UTC.
|
||||
*
|
||||
* @return the messageTime value.
|
||||
*/
|
||||
public OffsetDateTime getMessageTime() {
|
||||
return this.messageTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the messageTime property: Time this message was created in UTC.
|
||||
*
|
||||
* @param messageTime the messageTime value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setMessageTime(OffsetDateTime messageTime) {
|
||||
this.messageTime = messageTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the resourceId property: Identifier of the resource against which usage is emitted.
|
||||
*
|
||||
* @return the resourceId value.
|
||||
*/
|
||||
public UUID getResourceId() {
|
||||
return this.resourceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the resourceId property: Identifier of the resource against which usage is emitted.
|
||||
*
|
||||
* @param resourceId the resourceId value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setResourceId(UUID resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the resourceUri property: Identifier of the managed app resource against which usage is emitted.
|
||||
*
|
||||
* @return the resourceUri value.
|
||||
*/
|
||||
public String getResourceUri() {
|
||||
return this.resourceUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the resourceUri property: Identifier of the managed app resource against which usage is emitted.
|
||||
*
|
||||
* @param resourceUri the resourceUri value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setResourceUri(String resourceUri) {
|
||||
this.resourceUri = resourceUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quantity property: Number of units consumed.
|
||||
*
|
||||
* @return the quantity value.
|
||||
*/
|
||||
public Double getQuantity() {
|
||||
return this.quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the quantity property: Number of units consumed.
|
||||
*
|
||||
* @param quantity the quantity value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setQuantity(Double quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dimension property: Dimension identifier.
|
||||
*
|
||||
* @return the dimension value.
|
||||
*/
|
||||
public String getDimension() {
|
||||
return this.dimension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dimension property: Dimension identifier.
|
||||
*
|
||||
* @param dimension the dimension value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setDimension(String dimension) {
|
||||
this.dimension = dimension;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the effectiveStartTime property: Time in UTC when the usage event occurred.
|
||||
*
|
||||
* @return the effectiveStartTime value.
|
||||
*/
|
||||
public OffsetDateTime getEffectiveStartTime() {
|
||||
return this.effectiveStartTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the effectiveStartTime property: Time in UTC when the usage event occurred.
|
||||
*
|
||||
* @param effectiveStartTime the effectiveStartTime value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setEffectiveStartTime(OffsetDateTime effectiveStartTime) {
|
||||
this.effectiveStartTime = effectiveStartTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the planId property: Plan associated with the purchased offer.
|
||||
*
|
||||
* @return the planId value.
|
||||
*/
|
||||
public String getPlanId() {
|
||||
return this.planId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the planId property: Plan associated with the purchased offer.
|
||||
*
|
||||
* @param planId the planId value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setPlanId(String planId) {
|
||||
this.planId = planId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the error property: The error property.
|
||||
*
|
||||
* @return the error value.
|
||||
*/
|
||||
public UsageEventConflictResponse getError() {
|
||||
return this.error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the error property: The error property.
|
||||
*
|
||||
* @param error the error value to set.
|
||||
* @return the UsageBatchEventOkMessage object itself.
|
||||
*/
|
||||
public UsageBatchEventOkMessage setError(UsageEventConflictResponse error) {
|
||||
this.error = error;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@ public final class UsageEvent {
|
|||
* Number of units consumed
|
||||
*/
|
||||
@JsonProperty(value = "quantity")
|
||||
private Long quantity;
|
||||
private Double quantity;
|
||||
|
||||
/*
|
||||
* Dimension identifier
|
||||
|
@ -107,7 +107,7 @@ public final class UsageEvent {
|
|||
*
|
||||
* @return the quantity value.
|
||||
*/
|
||||
public Long getQuantity() {
|
||||
public Double getQuantity() {
|
||||
return this.quantity;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ public final class UsageEvent {
|
|||
* @param quantity the quantity value to set.
|
||||
* @return the UsageEvent object itself.
|
||||
*/
|
||||
public UsageEvent setQuantity(Long quantity) {
|
||||
public UsageEvent setQuantity(Double quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.meter.models;
|
||||
|
||||
import com.azure.core.exception.HttpResponseException;
|
||||
import com.azure.core.http.HttpResponse;
|
||||
|
||||
/** Exception thrown for an invalid response with UsageEventBadRequestResponse information. */
|
||||
public final class UsageEventBadRequestResponseException extends HttpResponseException {
|
||||
/**
|
||||
* Initializes a new instance of the UsageEventBadRequestResponseException class.
|
||||
*
|
||||
* @param message the exception message or the response content if a message is not available.
|
||||
* @param response the HTTP response.
|
||||
*/
|
||||
public UsageEventBadRequestResponseException(String message, HttpResponse response) {
|
||||
super(message, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the UsageEventBadRequestResponseException class.
|
||||
*
|
||||
* @param message the exception message or the response content if a message is not available.
|
||||
* @param response the HTTP response.
|
||||
* @param value the deserialized response value.
|
||||
*/
|
||||
public UsageEventBadRequestResponseException(
|
||||
String message, HttpResponse response, UsageEventBadRequestResponse value) {
|
||||
super(message, response, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UsageEventBadRequestResponse getValue() {
|
||||
return (UsageEventBadRequestResponse) super.getValue();
|
||||
}
|
||||
}
|
|
@ -14,37 +14,23 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
/** The UsageEventConflictResponse model. */
|
||||
@Fluent
|
||||
public final class UsageEventConflictResponse {
|
||||
/*
|
||||
* The code property.
|
||||
*/
|
||||
@JsonProperty(value = "code")
|
||||
private String code;
|
||||
|
||||
/*
|
||||
* The additionalInfo property.
|
||||
*/
|
||||
@JsonProperty(value = "additionalInfo")
|
||||
private UsageEventConflictResponseAdditionalInfo additionalInfo;
|
||||
|
||||
/**
|
||||
* Get the code property: The code property.
|
||||
*
|
||||
* @return the code value.
|
||||
/*
|
||||
* The message property.
|
||||
*/
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
@JsonProperty(value = "message")
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* Set the code property: The code property.
|
||||
*
|
||||
* @param code the code value to set.
|
||||
* @return the UsageEventConflictResponse object itself.
|
||||
/*
|
||||
* The code property.
|
||||
*/
|
||||
public UsageEventConflictResponse setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
@JsonProperty(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* Get the additionalInfo property: The additionalInfo property.
|
||||
|
@ -65,4 +51,44 @@ public final class UsageEventConflictResponse {
|
|||
this.additionalInfo = additionalInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message property: The message property.
|
||||
*
|
||||
* @return the message value.
|
||||
*/
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the message property: The message property.
|
||||
*
|
||||
* @param message the message value to set.
|
||||
* @return the UsageEventConflictResponse object itself.
|
||||
*/
|
||||
public UsageEventConflictResponse setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the code property: The code property.
|
||||
*
|
||||
* @return the code value.
|
||||
*/
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the code property: The code property.
|
||||
*
|
||||
* @param code the code value to set.
|
||||
* @return the UsageEventConflictResponse object itself.
|
||||
*/
|
||||
public UsageEventConflictResponse setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,243 +10,33 @@ package com.microsoft.marketplace.meter.models;
|
|||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
/** The UsageEventConflictResponseAdditionalInfo model. */
|
||||
@Fluent
|
||||
public final class UsageEventConflictResponseAdditionalInfo {
|
||||
/*
|
||||
* Unique identifier associated with the usage event
|
||||
* The acceptedMessage property.
|
||||
*/
|
||||
@JsonProperty(value = "usageEventId")
|
||||
private UUID usageEventId;
|
||||
|
||||
/*
|
||||
* Accepted|NotProcessed|Expired
|
||||
*/
|
||||
@JsonProperty(value = "status")
|
||||
private UsageEventConflictResponseAdditionalInfoStatus status;
|
||||
|
||||
/*
|
||||
* Time this message was created in UTC
|
||||
*/
|
||||
@JsonProperty(value = "messageTime")
|
||||
private OffsetDateTime messageTime;
|
||||
|
||||
/*
|
||||
* Identifier of the resource against which usage is emitted
|
||||
*/
|
||||
@JsonProperty(value = "resourceId")
|
||||
private UUID resourceId;
|
||||
|
||||
/*
|
||||
* Identifier of the managed app resource against which usage is emitted
|
||||
*/
|
||||
@JsonProperty(value = "resourceUri")
|
||||
private String resourceUri;
|
||||
|
||||
/*
|
||||
* The quantity property.
|
||||
*/
|
||||
@JsonProperty(value = "quantity")
|
||||
private Long quantity;
|
||||
|
||||
/*
|
||||
* Dimension identifier
|
||||
*/
|
||||
@JsonProperty(value = "dimension")
|
||||
private String dimension;
|
||||
|
||||
/*
|
||||
* Time in UTC when the usage event occurred
|
||||
*/
|
||||
@JsonProperty(value = "effectiveStartTime")
|
||||
private OffsetDateTime effectiveStartTime;
|
||||
|
||||
/*
|
||||
* Plan associated with the purchased offer
|
||||
*/
|
||||
@JsonProperty(value = "planId")
|
||||
private UUID planId;
|
||||
@JsonProperty(value = "acceptedMessage")
|
||||
private UsageEventOkResponse acceptedMessage;
|
||||
|
||||
/**
|
||||
* Get the usageEventId property: Unique identifier associated with the usage event.
|
||||
* Get the acceptedMessage property: The acceptedMessage property.
|
||||
*
|
||||
* @return the usageEventId value.
|
||||
* @return the acceptedMessage value.
|
||||
*/
|
||||
public UUID getUsageEventId() {
|
||||
return this.usageEventId;
|
||||
public UsageEventOkResponse getAcceptedMessage() {
|
||||
return this.acceptedMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the usageEventId property: Unique identifier associated with the usage event.
|
||||
* Set the acceptedMessage property: The acceptedMessage property.
|
||||
*
|
||||
* @param usageEventId the usageEventId value to set.
|
||||
* @param acceptedMessage the acceptedMessage value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setUsageEventId(UUID usageEventId) {
|
||||
this.usageEventId = usageEventId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the status property: Accepted|NotProcessed|Expired.
|
||||
*
|
||||
* @return the status value.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfoStatus getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the status property: Accepted|NotProcessed|Expired.
|
||||
*
|
||||
* @param status the status value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setStatus(UsageEventConflictResponseAdditionalInfoStatus status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the messageTime property: Time this message was created in UTC.
|
||||
*
|
||||
* @return the messageTime value.
|
||||
*/
|
||||
public OffsetDateTime getMessageTime() {
|
||||
return this.messageTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the messageTime property: Time this message was created in UTC.
|
||||
*
|
||||
* @param messageTime the messageTime value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setMessageTime(OffsetDateTime messageTime) {
|
||||
this.messageTime = messageTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the resourceId property: Identifier of the resource against which usage is emitted.
|
||||
*
|
||||
* @return the resourceId value.
|
||||
*/
|
||||
public UUID getResourceId() {
|
||||
return this.resourceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the resourceId property: Identifier of the resource against which usage is emitted.
|
||||
*
|
||||
* @param resourceId the resourceId value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setResourceId(UUID resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the resourceUri property: Identifier of the managed app resource against which usage is emitted.
|
||||
*
|
||||
* @return the resourceUri value.
|
||||
*/
|
||||
public String getResourceUri() {
|
||||
return this.resourceUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the resourceUri property: Identifier of the managed app resource against which usage is emitted.
|
||||
*
|
||||
* @param resourceUri the resourceUri value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setResourceUri(String resourceUri) {
|
||||
this.resourceUri = resourceUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quantity property: The quantity property.
|
||||
*
|
||||
* @return the quantity value.
|
||||
*/
|
||||
public Long getQuantity() {
|
||||
return this.quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the quantity property: The quantity property.
|
||||
*
|
||||
* @param quantity the quantity value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setQuantity(Long quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dimension property: Dimension identifier.
|
||||
*
|
||||
* @return the dimension value.
|
||||
*/
|
||||
public String getDimension() {
|
||||
return this.dimension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dimension property: Dimension identifier.
|
||||
*
|
||||
* @param dimension the dimension value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setDimension(String dimension) {
|
||||
this.dimension = dimension;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the effectiveStartTime property: Time in UTC when the usage event occurred.
|
||||
*
|
||||
* @return the effectiveStartTime value.
|
||||
*/
|
||||
public OffsetDateTime getEffectiveStartTime() {
|
||||
return this.effectiveStartTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the effectiveStartTime property: Time in UTC when the usage event occurred.
|
||||
*
|
||||
* @param effectiveStartTime the effectiveStartTime value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setEffectiveStartTime(OffsetDateTime effectiveStartTime) {
|
||||
this.effectiveStartTime = effectiveStartTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the planId property: Plan associated with the purchased offer.
|
||||
*
|
||||
* @return the planId value.
|
||||
*/
|
||||
public UUID getPlanId() {
|
||||
return this.planId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the planId property: Plan associated with the purchased offer.
|
||||
*
|
||||
* @param planId the planId value to set.
|
||||
* @return the UsageEventConflictResponseAdditionalInfo object itself.
|
||||
*/
|
||||
public UsageEventConflictResponseAdditionalInfo setPlanId(UUID planId) {
|
||||
this.planId = planId;
|
||||
public UsageEventConflictResponseAdditionalInfo setAcceptedMessage(UsageEventOkResponse acceptedMessage) {
|
||||
this.acceptedMessage = acceptedMessage;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.meter.models;
|
||||
|
||||
import com.azure.core.exception.HttpResponseException;
|
||||
import com.azure.core.http.HttpResponse;
|
||||
|
||||
/** Exception thrown for an invalid response with UsageEventConflictResponse information. */
|
||||
public final class UsageEventConflictResponseException extends HttpResponseException {
|
||||
/**
|
||||
* Initializes a new instance of the UsageEventConflictResponseException class.
|
||||
*
|
||||
* @param message the exception message or the response content if a message is not available.
|
||||
* @param response the HTTP response.
|
||||
*/
|
||||
public UsageEventConflictResponseException(String message, HttpResponse response) {
|
||||
super(message, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the UsageEventConflictResponseException class.
|
||||
*
|
||||
* @param message the exception message or the response content if a message is not available.
|
||||
* @param response the HTTP response.
|
||||
* @param value the deserialized response value.
|
||||
*/
|
||||
public UsageEventConflictResponseException(
|
||||
String message, HttpResponse response, UsageEventConflictResponse value) {
|
||||
super(message, response, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UsageEventConflictResponse getValue() {
|
||||
return (UsageEventConflictResponse) super.getValue();
|
||||
}
|
||||
}
|
|
@ -50,7 +50,7 @@ public final class UsageEventOkResponse {
|
|||
* Number of units consumed
|
||||
*/
|
||||
@JsonProperty(value = "quantity")
|
||||
private Long quantity;
|
||||
private Double quantity;
|
||||
|
||||
/*
|
||||
* Dimension identifier
|
||||
|
@ -175,7 +175,7 @@ public final class UsageEventOkResponse {
|
|||
*
|
||||
* @return the quantity value.
|
||||
*/
|
||||
public Long getQuantity() {
|
||||
public Double getQuantity() {
|
||||
return this.quantity;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ public final class UsageEventOkResponse {
|
|||
* @param quantity the quantity value to set.
|
||||
* @return the UsageEventOkResponse object itself.
|
||||
*/
|
||||
public UsageEventOkResponse setQuantity(Long quantity) {
|
||||
public UsageEventOkResponse setQuantity(Double quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,14 @@ public enum UsageEventStatusEnum {
|
|||
/** Enum value ResourceNotAuthorized. */
|
||||
RESOURCE_NOT_AUTHORIZED("ResourceNotAuthorized"),
|
||||
|
||||
/** Enum value InvalidDimension|BadArgument. */
|
||||
INVALID_DIMENSION_BAD_ARGUMENT("InvalidDimension|BadArgument");
|
||||
/** Enum value InvalidDimension. */
|
||||
INVALID_DIMENSION("InvalidDimension"),
|
||||
|
||||
/** Enum value InvalidQuantity. */
|
||||
INVALID_QUANTITY("InvalidQuantity"),
|
||||
|
||||
/** Enum value BadArgument. */
|
||||
BAD_ARGUMENT("BadArgument");
|
||||
|
||||
/** The actual serialized value for a UsageEventStatusEnum instance. */
|
||||
private final String value;
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class FulfillmentOperations {
|
|||
@ServiceInterface(name = "SaaSAPIFulfillmentOp")
|
||||
private interface FulfillmentOperationsService {
|
||||
@Post("/saas/subscriptions/resolve")
|
||||
@ExpectedResponses({200, 400, 403, 404, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<ResolvedSubscription>> resolve(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -75,7 +75,7 @@ public final class FulfillmentOperations {
|
|||
@HeaderParam("x-ms-marketplace-token") String xMsMarketplaceToken);
|
||||
|
||||
@Get("/saas/subscriptions/")
|
||||
@ExpectedResponses({200, 403, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<SubscriptionsResponse>> listSubscriptions(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -85,7 +85,7 @@ public final class FulfillmentOperations {
|
|||
@HeaderParam("x-ms-correlationid") UUID correlationId);
|
||||
|
||||
@Get("/saas/subscriptions/{subscriptionId}")
|
||||
@ExpectedResponses({200, 403, 404, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<Subscription>> getSubscription(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -95,7 +95,7 @@ public final class FulfillmentOperations {
|
|||
@HeaderParam("x-ms-correlationid") UUID correlationId);
|
||||
|
||||
@Patch("/saas/subscriptions/{subscriptionId}")
|
||||
@ExpectedResponses({202, 400, 403, 404, 500})
|
||||
@ExpectedResponses({202})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<FulfillmentOperationsUpdateSubscriptionResponse> updateSubscription(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -106,7 +106,7 @@ public final class FulfillmentOperations {
|
|||
@BodyParam("application/json") SubscriberPlan body);
|
||||
|
||||
@Delete("/saas/subscriptions/{subscriptionId}")
|
||||
@ExpectedResponses({202, 400, 403, 404, 500})
|
||||
@ExpectedResponses({202})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<FulfillmentOperationsDeleteSubscriptionResponse> deleteSubscription(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -116,7 +116,7 @@ public final class FulfillmentOperations {
|
|||
@HeaderParam("x-ms-correlationid") UUID correlationId);
|
||||
|
||||
@Get("/saas/subscriptions/{subscriptionId}/listAvailablePlans")
|
||||
@ExpectedResponses({200, 403, 404, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<SubscriptionPlans>> listAvailablePlans(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -126,7 +126,7 @@ public final class FulfillmentOperations {
|
|||
@HeaderParam("x-ms-correlationid") UUID correlationId);
|
||||
|
||||
@Post("/saas/subscriptions/{subscriptionId}/activate")
|
||||
@ExpectedResponses({200, 400, 403, 404, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<Void>> activateSubscription(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -137,7 +137,7 @@ public final class FulfillmentOperations {
|
|||
@BodyParam("application/json") SubscriberPlan body);
|
||||
|
||||
@Get("{nextLink}")
|
||||
@ExpectedResponses({200, 403, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<SubscriptionsResponse>> listSubscriptionsNext(
|
||||
@PathParam(value = "nextLink", encoded = true) String nextLink);
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class SubscriptionOperations {
|
|||
@ServiceInterface(name = "SaaSAPISubscriptionO")
|
||||
private interface SubscriptionOperationsService {
|
||||
@Get("/saas/subscriptions/{subscriptionId}/operations")
|
||||
@ExpectedResponses({200, 400, 403, 404, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<OperationList>> listOperations(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -66,7 +66,7 @@ public final class SubscriptionOperations {
|
|||
@HeaderParam("x-ms-correlationid") UUID correlationId);
|
||||
|
||||
@Get("/saas/subscriptions/{subscriptionId}/operations/{operationId}")
|
||||
@ExpectedResponses({200, 400, 403, 404, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<Operation>> getOperationStatus(
|
||||
@HostParam("$host") String host,
|
||||
|
@ -77,7 +77,7 @@ public final class SubscriptionOperations {
|
|||
@HeaderParam("x-ms-correlationid") UUID correlationId);
|
||||
|
||||
@Patch("/saas/subscriptions/{subscriptionId}/operations/{operationId}")
|
||||
@ExpectedResponses({200, 400, 403, 404, 409, 500})
|
||||
@ExpectedResponses({200})
|
||||
@UnexpectedResponseExceptionType(HttpResponseException.class)
|
||||
Mono<Response<Void>> updateOperationStatus(
|
||||
@HostParam("$host") String host,
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.saas.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/** The MeteringDimension model. */
|
||||
@Fluent
|
||||
public final class MeteringDimension {
|
||||
/*
|
||||
* The id property.
|
||||
*/
|
||||
@JsonProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/*
|
||||
* The currency property.
|
||||
*/
|
||||
@JsonProperty(value = "currency")
|
||||
private String currency;
|
||||
|
||||
/*
|
||||
* The pricePerUnit property.
|
||||
*/
|
||||
@JsonProperty(value = "pricePerUnit")
|
||||
private Float pricePerUnit;
|
||||
|
||||
/*
|
||||
* The unitOfMeasure property.
|
||||
*/
|
||||
@JsonProperty(value = "unitOfMeasure")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/*
|
||||
* The displayName property.
|
||||
*/
|
||||
@JsonProperty(value = "displayName")
|
||||
private String displayName;
|
||||
|
||||
/**
|
||||
* Get the id property: The id property.
|
||||
*
|
||||
* @return the id value.
|
||||
*/
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the id property: The id property.
|
||||
*
|
||||
* @param id the id value to set.
|
||||
* @return the MeteringDimension object itself.
|
||||
*/
|
||||
public MeteringDimension setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currency property: The currency property.
|
||||
*
|
||||
* @return the currency value.
|
||||
*/
|
||||
public String getCurrency() {
|
||||
return this.currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the currency property: The currency property.
|
||||
*
|
||||
* @param currency the currency value to set.
|
||||
* @return the MeteringDimension object itself.
|
||||
*/
|
||||
public MeteringDimension setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the pricePerUnit property: The pricePerUnit property.
|
||||
*
|
||||
* @return the pricePerUnit value.
|
||||
*/
|
||||
public Float getPricePerUnit() {
|
||||
return this.pricePerUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the pricePerUnit property: The pricePerUnit property.
|
||||
*
|
||||
* @param pricePerUnit the pricePerUnit value to set.
|
||||
* @return the MeteringDimension object itself.
|
||||
*/
|
||||
public MeteringDimension setPricePerUnit(Float pricePerUnit) {
|
||||
this.pricePerUnit = pricePerUnit;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unitOfMeasure property: The unitOfMeasure property.
|
||||
*
|
||||
* @return the unitOfMeasure value.
|
||||
*/
|
||||
public String getUnitOfMeasure() {
|
||||
return this.unitOfMeasure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the unitOfMeasure property: The unitOfMeasure property.
|
||||
*
|
||||
* @param unitOfMeasure the unitOfMeasure value to set.
|
||||
* @return the MeteringDimension object itself.
|
||||
*/
|
||||
public MeteringDimension setUnitOfMeasure(String unitOfMeasure) {
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the displayName property: The displayName property.
|
||||
*
|
||||
* @return the displayName value.
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return this.displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the displayName property: The displayName property.
|
||||
*
|
||||
* @param displayName the displayName value to set.
|
||||
* @return the MeteringDimension object itself.
|
||||
*/
|
||||
public MeteringDimension setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.saas.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/** The MeteringedQuantityIncluded model. */
|
||||
@Fluent
|
||||
public final class MeteringedQuantityIncluded {
|
||||
/*
|
||||
* The dimensionId property.
|
||||
*/
|
||||
@JsonProperty(value = "dimensionId")
|
||||
private String dimensionId;
|
||||
|
||||
/*
|
||||
* The units property.
|
||||
*/
|
||||
@JsonProperty(value = "units")
|
||||
private String units;
|
||||
|
||||
/**
|
||||
* Get the dimensionId property: The dimensionId property.
|
||||
*
|
||||
* @return the dimensionId value.
|
||||
*/
|
||||
public String getDimensionId() {
|
||||
return this.dimensionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dimensionId property: The dimensionId property.
|
||||
*
|
||||
* @param dimensionId the dimensionId value to set.
|
||||
* @return the MeteringedQuantityIncluded object itself.
|
||||
*/
|
||||
public MeteringedQuantityIncluded setDimensionId(String dimensionId) {
|
||||
this.dimensionId = dimensionId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the units property: The units property.
|
||||
*
|
||||
* @return the units value.
|
||||
*/
|
||||
public String getUnits() {
|
||||
return this.units;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the units property: The units property.
|
||||
*
|
||||
* @param units the units value to set.
|
||||
* @return the MeteringedQuantityIncluded object itself.
|
||||
*/
|
||||
public MeteringedQuantityIncluded setUnits(String units) {
|
||||
this.units = units;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -32,6 +32,42 @@ public final class Plan {
|
|||
@JsonProperty(value = "isPrivate")
|
||||
private Boolean isPrivate;
|
||||
|
||||
/*
|
||||
* The description property.
|
||||
*/
|
||||
@JsonProperty(value = "description")
|
||||
private String description;
|
||||
|
||||
/*
|
||||
* The hasFreeTrials property.
|
||||
*/
|
||||
@JsonProperty(value = "hasFreeTrials")
|
||||
private Boolean hasFreeTrials;
|
||||
|
||||
/*
|
||||
* The isPricePerSeat property.
|
||||
*/
|
||||
@JsonProperty(value = "isPricePerSeat")
|
||||
private Boolean isPricePerSeat;
|
||||
|
||||
/*
|
||||
* The isStopSell property.
|
||||
*/
|
||||
@JsonProperty(value = "isStopSell")
|
||||
private Boolean isStopSell;
|
||||
|
||||
/*
|
||||
* The market property.
|
||||
*/
|
||||
@JsonProperty(value = "market")
|
||||
private String market;
|
||||
|
||||
/*
|
||||
* The planComponents property.
|
||||
*/
|
||||
@JsonProperty(value = "planComponents")
|
||||
private PlanComponents planComponents;
|
||||
|
||||
/**
|
||||
* Get the planId property: The planId property.
|
||||
*
|
||||
|
@ -91,4 +127,124 @@ public final class Plan {
|
|||
this.isPrivate = isPrivate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the description property: The description property.
|
||||
*
|
||||
* @return the description value.
|
||||
*/
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the description property: The description property.
|
||||
*
|
||||
* @param description the description value to set.
|
||||
* @return the Plan object itself.
|
||||
*/
|
||||
public Plan setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the hasFreeTrials property: The hasFreeTrials property.
|
||||
*
|
||||
* @return the hasFreeTrials value.
|
||||
*/
|
||||
public Boolean isHasFreeTrials() {
|
||||
return this.hasFreeTrials;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the hasFreeTrials property: The hasFreeTrials property.
|
||||
*
|
||||
* @param hasFreeTrials the hasFreeTrials value to set.
|
||||
* @return the Plan object itself.
|
||||
*/
|
||||
public Plan setHasFreeTrials(Boolean hasFreeTrials) {
|
||||
this.hasFreeTrials = hasFreeTrials;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the isPricePerSeat property: The isPricePerSeat property.
|
||||
*
|
||||
* @return the isPricePerSeat value.
|
||||
*/
|
||||
public Boolean isPricePerSeat() {
|
||||
return this.isPricePerSeat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the isPricePerSeat property: The isPricePerSeat property.
|
||||
*
|
||||
* @param isPricePerSeat the isPricePerSeat value to set.
|
||||
* @return the Plan object itself.
|
||||
*/
|
||||
public Plan setIsPricePerSeat(Boolean isPricePerSeat) {
|
||||
this.isPricePerSeat = isPricePerSeat;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the isStopSell property: The isStopSell property.
|
||||
*
|
||||
* @return the isStopSell value.
|
||||
*/
|
||||
public Boolean isStopSell() {
|
||||
return this.isStopSell;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the isStopSell property: The isStopSell property.
|
||||
*
|
||||
* @param isStopSell the isStopSell value to set.
|
||||
* @return the Plan object itself.
|
||||
*/
|
||||
public Plan setIsStopSell(Boolean isStopSell) {
|
||||
this.isStopSell = isStopSell;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the market property: The market property.
|
||||
*
|
||||
* @return the market value.
|
||||
*/
|
||||
public String getMarket() {
|
||||
return this.market;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the market property: The market property.
|
||||
*
|
||||
* @param market the market value to set.
|
||||
* @return the Plan object itself.
|
||||
*/
|
||||
public Plan setMarket(String market) {
|
||||
this.market = market;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the planComponents property: The planComponents property.
|
||||
*
|
||||
* @return the planComponents value.
|
||||
*/
|
||||
public PlanComponents getPlanComponents() {
|
||||
return this.planComponents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the planComponents property: The planComponents property.
|
||||
*
|
||||
* @param planComponents the planComponents value to set.
|
||||
* @return the Plan object itself.
|
||||
*/
|
||||
public Plan setPlanComponents(PlanComponents planComponents) {
|
||||
this.planComponents = planComponents;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.saas.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
|
||||
/** The PlanComponents model. */
|
||||
@Fluent
|
||||
public final class PlanComponents {
|
||||
/*
|
||||
* The recurrentBillingTerms property.
|
||||
*/
|
||||
@JsonProperty(value = "recurrentBillingTerms")
|
||||
private List<RecurrentBillingTerm> recurrentBillingTerms;
|
||||
|
||||
/*
|
||||
* The meteringDimensions property.
|
||||
*/
|
||||
@JsonProperty(value = "meteringDimensions")
|
||||
private List<MeteringDimension> meteringDimensions;
|
||||
|
||||
/**
|
||||
* Get the recurrentBillingTerms property: The recurrentBillingTerms property.
|
||||
*
|
||||
* @return the recurrentBillingTerms value.
|
||||
*/
|
||||
public List<RecurrentBillingTerm> getRecurrentBillingTerms() {
|
||||
return this.recurrentBillingTerms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the recurrentBillingTerms property: The recurrentBillingTerms property.
|
||||
*
|
||||
* @param recurrentBillingTerms the recurrentBillingTerms value to set.
|
||||
* @return the PlanComponents object itself.
|
||||
*/
|
||||
public PlanComponents setRecurrentBillingTerms(List<RecurrentBillingTerm> recurrentBillingTerms) {
|
||||
this.recurrentBillingTerms = recurrentBillingTerms;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the meteringDimensions property: The meteringDimensions property.
|
||||
*
|
||||
* @return the meteringDimensions value.
|
||||
*/
|
||||
public List<MeteringDimension> getMeteringDimensions() {
|
||||
return this.meteringDimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the meteringDimensions property: The meteringDimensions property.
|
||||
*
|
||||
* @param meteringDimensions the meteringDimensions value to set.
|
||||
* @return the PlanComponents object itself.
|
||||
*/
|
||||
public PlanComponents setMeteringDimensions(List<MeteringDimension> meteringDimensions) {
|
||||
this.meteringDimensions = meteringDimensions;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.saas.models;
|
||||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.util.List;
|
||||
|
||||
/** The RecurrentBillingTerm model. */
|
||||
@Fluent
|
||||
public final class RecurrentBillingTerm {
|
||||
/*
|
||||
* The currency property.
|
||||
*/
|
||||
@JsonProperty(value = "currency")
|
||||
private String currency;
|
||||
|
||||
/*
|
||||
* The price property.
|
||||
*/
|
||||
@JsonProperty(value = "price")
|
||||
private Float price;
|
||||
|
||||
/*
|
||||
* The termUnit property.
|
||||
*/
|
||||
@JsonProperty(value = "termUnit")
|
||||
private TermUnitEnum termUnit;
|
||||
|
||||
/*
|
||||
* The termDescription property.
|
||||
*/
|
||||
@JsonProperty(value = "termDescription")
|
||||
private String termDescription;
|
||||
|
||||
/*
|
||||
* The meteredQuantityIncluded property.
|
||||
*/
|
||||
@JsonProperty(value = "meteredQuantityIncluded")
|
||||
private List<MeteringedQuantityIncluded> meteredQuantityIncluded;
|
||||
|
||||
/**
|
||||
* Get the currency property: The currency property.
|
||||
*
|
||||
* @return the currency value.
|
||||
*/
|
||||
public String getCurrency() {
|
||||
return this.currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the currency property: The currency property.
|
||||
*
|
||||
* @param currency the currency value to set.
|
||||
* @return the RecurrentBillingTerm object itself.
|
||||
*/
|
||||
public RecurrentBillingTerm setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the price property: The price property.
|
||||
*
|
||||
* @return the price value.
|
||||
*/
|
||||
public Float getPrice() {
|
||||
return this.price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the price property: The price property.
|
||||
*
|
||||
* @param price the price value to set.
|
||||
* @return the RecurrentBillingTerm object itself.
|
||||
*/
|
||||
public RecurrentBillingTerm setPrice(Float price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the termUnit property: The termUnit property.
|
||||
*
|
||||
* @return the termUnit value.
|
||||
*/
|
||||
public TermUnitEnum getTermUnit() {
|
||||
return this.termUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the termUnit property: The termUnit property.
|
||||
*
|
||||
* @param termUnit the termUnit value to set.
|
||||
* @return the RecurrentBillingTerm object itself.
|
||||
*/
|
||||
public RecurrentBillingTerm setTermUnit(TermUnitEnum termUnit) {
|
||||
this.termUnit = termUnit;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the termDescription property: The termDescription property.
|
||||
*
|
||||
* @return the termDescription value.
|
||||
*/
|
||||
public String getTermDescription() {
|
||||
return this.termDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the termDescription property: The termDescription property.
|
||||
*
|
||||
* @param termDescription the termDescription value to set.
|
||||
* @return the RecurrentBillingTerm object itself.
|
||||
*/
|
||||
public RecurrentBillingTerm setTermDescription(String termDescription) {
|
||||
this.termDescription = termDescription;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the meteredQuantityIncluded property: The meteredQuantityIncluded property.
|
||||
*
|
||||
* @return the meteredQuantityIncluded value.
|
||||
*/
|
||||
public List<MeteringedQuantityIncluded> getMeteredQuantityIncluded() {
|
||||
return this.meteredQuantityIncluded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the meteredQuantityIncluded property: The meteredQuantityIncluded property.
|
||||
*
|
||||
* @param meteredQuantityIncluded the meteredQuantityIncluded value to set.
|
||||
* @return the RecurrentBillingTerm object itself.
|
||||
*/
|
||||
public RecurrentBillingTerm setMeteredQuantityIncluded(List<MeteringedQuantityIncluded> meteredQuantityIncluded) {
|
||||
this.meteredQuantityIncluded = meteredQuantityIncluded;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ package com.microsoft.marketplace.saas.models;
|
|||
|
||||
import com.azure.core.annotation.Fluent;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -76,6 +77,12 @@ public final class Subscription {
|
|||
@JsonProperty(value = "term")
|
||||
private SubscriptionTerm term;
|
||||
|
||||
/*
|
||||
* Indicating whether the subscription will renew automatically.
|
||||
*/
|
||||
@JsonProperty(value = "autoRenew")
|
||||
private Boolean autoRenew;
|
||||
|
||||
/*
|
||||
* Indicating whether the current subscription is a test asset.
|
||||
*/
|
||||
|
@ -114,6 +121,18 @@ public final class Subscription {
|
|||
@JsonProperty(value = "storeFront")
|
||||
private String storeFront;
|
||||
|
||||
/*
|
||||
* Possible Values are None, Csp (Csp sandbox purchase)
|
||||
*/
|
||||
@JsonProperty(value = "sandboxType")
|
||||
private SandboxTypeEnum sandboxType;
|
||||
|
||||
/*
|
||||
* The created property.
|
||||
*/
|
||||
@JsonProperty(value = "created")
|
||||
private OffsetDateTime created;
|
||||
|
||||
/*
|
||||
* Dry Run indicates all transactions run as Test-Mode in the commerce
|
||||
* stack
|
||||
|
@ -121,12 +140,6 @@ public final class Subscription {
|
|||
@JsonProperty(value = "sessionMode")
|
||||
private SessionModeEnum sessionMode;
|
||||
|
||||
/*
|
||||
* Possible Values are None, Csp (Csp sandbox purchase)
|
||||
*/
|
||||
@JsonProperty(value = "sandboxType")
|
||||
private SandboxTypeEnum sandboxType;
|
||||
|
||||
/**
|
||||
* Get the id property: The id property.
|
||||
*
|
||||
|
@ -327,6 +340,26 @@ public final class Subscription {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the autoRenew property: Indicating whether the subscription will renew automatically.
|
||||
*
|
||||
* @return the autoRenew value.
|
||||
*/
|
||||
public Boolean isAutoRenew() {
|
||||
return this.autoRenew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the autoRenew property: Indicating whether the subscription will renew automatically.
|
||||
*
|
||||
* @param autoRenew the autoRenew value to set.
|
||||
* @return the Subscription object itself.
|
||||
*/
|
||||
public Subscription setAutoRenew(Boolean autoRenew) {
|
||||
this.autoRenew = autoRenew;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the isTest property: Indicating whether the current subscription is a test asset.
|
||||
*
|
||||
|
@ -449,26 +482,6 @@ public final class Subscription {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sessionMode property: Dry Run indicates all transactions run as Test-Mode in the commerce stack.
|
||||
*
|
||||
* @return the sessionMode value.
|
||||
*/
|
||||
public SessionModeEnum getSessionMode() {
|
||||
return this.sessionMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sessionMode property: Dry Run indicates all transactions run as Test-Mode in the commerce stack.
|
||||
*
|
||||
* @param sessionMode the sessionMode value to set.
|
||||
* @return the Subscription object itself.
|
||||
*/
|
||||
public Subscription setSessionMode(SessionModeEnum sessionMode) {
|
||||
this.sessionMode = sessionMode;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sandboxType property: Possible Values are None, Csp (Csp sandbox purchase).
|
||||
*
|
||||
|
@ -488,4 +501,44 @@ public final class Subscription {
|
|||
this.sandboxType = sandboxType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the created property: The created property.
|
||||
*
|
||||
* @return the created value.
|
||||
*/
|
||||
public OffsetDateTime getCreated() {
|
||||
return this.created;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the created property: The created property.
|
||||
*
|
||||
* @param created the created value to set.
|
||||
* @return the Subscription object itself.
|
||||
*/
|
||||
public Subscription setCreated(OffsetDateTime created) {
|
||||
this.created = created;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the sessionMode property: Dry Run indicates all transactions run as Test-Mode in the commerce stack.
|
||||
*
|
||||
* @return the sessionMode value.
|
||||
*/
|
||||
public SessionModeEnum getSessionMode() {
|
||||
return this.sessionMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the sessionMode property: Dry Run indicates all transactions run as Test-Mode in the commerce stack.
|
||||
*
|
||||
* @param sessionMode the sessionMode value to set.
|
||||
* @return the Subscription object itself.
|
||||
*/
|
||||
public Subscription setSessionMode(SessionModeEnum sessionMode) {
|
||||
this.sessionMode = sessionMode;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for
|
||||
// license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
package com.microsoft.marketplace.saas.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/** Defines values for TermUnitEnum. */
|
||||
public enum TermUnitEnum {
|
||||
/** Enum value P1M. */
|
||||
P1M("P1M"),
|
||||
|
||||
/** Enum value P1Y. */
|
||||
P1Y("P1Y");
|
||||
|
||||
/** The actual serialized value for a TermUnitEnum instance. */
|
||||
private final String value;
|
||||
|
||||
TermUnitEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a serialized value to a TermUnitEnum instance.
|
||||
*
|
||||
* @param value the serialized value to parse.
|
||||
* @return the parsed TermUnitEnum object, or null if unable to parse.
|
||||
*/
|
||||
@JsonCreator
|
||||
public static TermUnitEnum fromString(String value) {
|
||||
TermUnitEnum[] items = TermUnitEnum.values();
|
||||
for (TermUnitEnum item : items) {
|
||||
if (item.toString().equalsIgnoreCase(value)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче