1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.channel.v1;
18
19import "google/api/resource.proto";
20
21option go_package = "cloud.google.com/go/channel/apiv1/channelpb;channelpb";
22option java_multiple_files = true;
23option java_outer_classname = "SubscriberEventProto";
24option java_package = "com.google.cloud.channel.v1";
25
26// Represents Pub/Sub message content describing customer update.
27message CustomerEvent {
28  // Type of customer event.
29  enum Type {
30    // Not used.
31    TYPE_UNSPECIFIED = 0;
32
33    // Primary domain for customer was changed.
34    PRIMARY_DOMAIN_CHANGED = 1;
35
36    // Primary domain of the customer has been verified.
37    PRIMARY_DOMAIN_VERIFIED = 2;
38  }
39
40  // Resource name of the customer.
41  // Format: accounts/{account_id}/customers/{customer_id}
42  string customer = 1 [(google.api.resource_reference) = {
43    type: "cloudchannel.googleapis.com/Customer"
44  }];
45
46  // Type of event which happened on the customer.
47  Type event_type = 2;
48}
49
50// Represents Pub/Sub message content describing entitlement update.
51message EntitlementEvent {
52  // Type of entitlement event.
53  enum Type {
54    // Not used.
55    TYPE_UNSPECIFIED = 0;
56
57    // A new entitlement was created.
58    CREATED = 1;
59
60    // The offer type associated with an entitlement was changed.
61    // This is not triggered if an entitlement converts from a commit offer to a
62    // flexible offer as part of a renewal.
63    PRICE_PLAN_SWITCHED = 3;
64
65    // Annual commitment for a commit plan was changed.
66    COMMITMENT_CHANGED = 4;
67
68    // An annual entitlement was renewed.
69    RENEWED = 5;
70
71    // Entitlement was suspended.
72    SUSPENDED = 6;
73
74    // Entitlement was unsuspended.
75    ACTIVATED = 7;
76
77    // Entitlement was cancelled.
78    CANCELLED = 8;
79
80    // Entitlement was upgraded or downgraded (e.g. from Google Workspace
81    // Business Standard to Google Workspace Business Plus).
82    SKU_CHANGED = 9;
83
84    // The renewal settings of an entitlement has changed.
85    RENEWAL_SETTING_CHANGED = 10;
86
87    // Paid service has started on trial entitlement.
88    PAID_SERVICE_STARTED = 11;
89
90    // License was assigned to or revoked from a user.
91    LICENSE_ASSIGNMENT_CHANGED = 12;
92
93    // License cap was changed for the entitlement.
94    LICENSE_CAP_CHANGED = 13;
95  }
96
97  // Resource name of an entitlement of the form:
98  // accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
99  string entitlement = 1 [(google.api.resource_reference) = {
100    type: "cloudchannel.googleapis.com/Entitlement"
101  }];
102
103  // Type of event which happened on the entitlement.
104  Type event_type = 2;
105}
106
107// Represents information which resellers will get as part of notification from
108// Pub/Sub.
109message SubscriberEvent {
110  // Specifies the Pub/Sub event provided to the partners.
111  // This is a required field.
112  oneof event {
113    // Customer event sent as part of Pub/Sub event to partners.
114    CustomerEvent customer_event = 1;
115
116    // Entitlement event sent as part of Pub/Sub event to partners.
117    EntitlementEvent entitlement_event = 2;
118  }
119}
120