diff --git a/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientHttpJsonTest.java b/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientHttpJsonTest.java index 2f6bc6c7aa03..1944ab0094e9 100644 --- a/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientHttpJsonTest.java +++ b/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientHttpJsonTest.java @@ -2795,6 +2795,7 @@ public void lookupOfferTest() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .addAllParameterDefinitions(new ArrayList()) + .setDealCode("dealCode509806713") .build(); mockService.addResponse(expectedResponse); diff --git a/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java b/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java index 18256b8e6395..15e4789382bb 100644 --- a/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java +++ b/java-channel/google-cloud-channel/src/test/java/com/google/cloud/channel/v1/CloudChannelServiceClientTest.java @@ -2576,6 +2576,7 @@ public void lookupOfferTest() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .addAllParameterDefinitions(new ArrayList()) + .setDealCode("dealCode509806713") .build(); mockCloudChannelService.addResponse(expectedResponse); diff --git a/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/Offer.java b/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/Offer.java index edd462a45a1b..60d5ec541c4c 100644 --- a/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/Offer.java +++ b/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/Offer.java @@ -43,6 +43,7 @@ private Offer() { name_ = ""; priceByResources_ = java.util.Collections.emptyList(); parameterDefinitions_ = java.util.Collections.emptyList(); + dealCode_ = ""; } @java.lang.Override @@ -546,6 +547,55 @@ public com.google.cloud.channel.v1.ParameterDefinitionOrBuilder getParameterDefi return parameterDefinitions_.get(index); } + public static final int DEAL_CODE_FIELD_NUMBER = 12; + private volatile java.lang.Object dealCode_; + /** + * + * + *
+   * The deal code of the offer to get a special promotion or discount.
+   * 
+ * + * string deal_code = 12; + * + * @return The dealCode. + */ + @java.lang.Override + public java.lang.String getDealCode() { + java.lang.Object ref = dealCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dealCode_ = s; + return s; + } + } + /** + * + * + *
+   * The deal code of the offer to get a special promotion or discount.
+   * 
+ * + * string deal_code = 12; + * + * @return The bytes for dealCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDealCodeBytes() { + java.lang.Object ref = dealCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dealCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -587,6 +637,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < parameterDefinitions_.size(); i++) { output.writeMessage(9, parameterDefinitions_.get(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dealCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, dealCode_); + } getUnknownFields().writeTo(output); } @@ -624,6 +677,9 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, parameterDefinitions_.get(i)); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dealCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, dealCode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -666,6 +722,7 @@ public boolean equals(final java.lang.Object obj) { if (!getEndTime().equals(other.getEndTime())) return false; } if (!getParameterDefinitionsList().equals(other.getParameterDefinitionsList())) return false; + if (!getDealCode().equals(other.getDealCode())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -711,6 +768,8 @@ public int hashCode() { hash = (37 * hash) + PARAMETER_DEFINITIONS_FIELD_NUMBER; hash = (53 * hash) + getParameterDefinitionsList().hashCode(); } + hash = (37 * hash) + DEAL_CODE_FIELD_NUMBER; + hash = (53 * hash) + getDealCode().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -902,6 +961,8 @@ public Builder clear() { parameterDefinitionsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); + dealCode_ = ""; + return this; } @@ -978,6 +1039,7 @@ public com.google.cloud.channel.v1.Offer buildPartial() { } else { result.parameterDefinitions_ = parameterDefinitionsBuilder_.build(); } + result.dealCode_ = dealCode_; onBuilt(); return result; } @@ -1103,6 +1165,10 @@ public Builder mergeFrom(com.google.cloud.channel.v1.Offer other) { } } } + if (!other.getDealCode().isEmpty()) { + dealCode_ = other.dealCode_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1198,6 +1264,12 @@ public Builder mergeFrom( } break; } // case 74 + case 98: + { + dealCode_ = input.readStringRequireUtf8(); + + break; + } // case 98 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -3144,6 +3216,112 @@ public com.google.cloud.channel.v1.ParameterDefinition.Builder addParameterDefin return parameterDefinitionsBuilder_; } + private java.lang.Object dealCode_ = ""; + /** + * + * + *
+     * The deal code of the offer to get a special promotion or discount.
+     * 
+ * + * string deal_code = 12; + * + * @return The dealCode. + */ + public java.lang.String getDealCode() { + java.lang.Object ref = dealCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dealCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The deal code of the offer to get a special promotion or discount.
+     * 
+ * + * string deal_code = 12; + * + * @return The bytes for dealCode. + */ + public com.google.protobuf.ByteString getDealCodeBytes() { + java.lang.Object ref = dealCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dealCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The deal code of the offer to get a special promotion or discount.
+     * 
+ * + * string deal_code = 12; + * + * @param value The dealCode to set. + * @return This builder for chaining. + */ + public Builder setDealCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dealCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The deal code of the offer to get a special promotion or discount.
+     * 
+ * + * string deal_code = 12; + * + * @return This builder for chaining. + */ + public Builder clearDealCode() { + + dealCode_ = getDefaultInstance().getDealCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * The deal code of the offer to get a special promotion or discount.
+     * 
+ * + * string deal_code = 12; + * + * @param value The bytes for dealCode to set. + * @return This builder for chaining. + */ + public Builder setDealCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dealCode_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OfferOrBuilder.java b/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OfferOrBuilder.java index 90f25a6dba45..d5b870a67723 100644 --- a/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OfferOrBuilder.java +++ b/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OfferOrBuilder.java @@ -367,4 +367,29 @@ public interface OfferOrBuilder */ com.google.cloud.channel.v1.ParameterDefinitionOrBuilder getParameterDefinitionsOrBuilder( int index); + + /** + * + * + *
+   * The deal code of the offer to get a special promotion or discount.
+   * 
+ * + * string deal_code = 12; + * + * @return The dealCode. + */ + java.lang.String getDealCode(); + /** + * + * + *
+   * The deal code of the offer to get a special promotion or discount.
+   * 
+ * + * string deal_code = 12; + * + * @return The bytes for dealCode. + */ + com.google.protobuf.ByteString getDealCodeBytes(); } diff --git a/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OffersProto.java b/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OffersProto.java index 50cce82ccbe5..89b96c57565c 100644 --- a/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OffersProto.java +++ b/java-channel/proto-google-cloud-channel-v1/src/main/java/com/google/cloud/channel/v1/OffersProto.java @@ -82,7 +82,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "oto\032$google/cloud/channel/v1/common.prot" + "o\032&google/cloud/channel/v1/products.prot" + "o\032\037google/protobuf/timestamp.proto\032\027goog" - + "le/type/money.proto\"\251\004\n\005Offer\022\014\n\004name\030\001 " + + "le/type/money.proto\"\274\004\n\005Offer\022\014\n\004name\030\001 " + "\001(\t\022>\n\016marketing_info\030\002 \001(\0132&.google.clo" + "ud.channel.v1.MarketingInfo\022)\n\003sku\030\003 \001(\013" + "2\034.google.cloud.channel.v1.Sku\022+\n\004plan\030\004" @@ -94,67 +94,67 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "uf.Timestamp\0221\n\010end_time\030\010 \001(\0132\032.google." + "protobuf.TimestampB\003\340A\003\022K\n\025parameter_def" + "initions\030\t \003(\0132,.google.cloud.channel.v1" - + ".ParameterDefinition:I\352AF\n!cloudchannel." - + "googleapis.com/Offer\022!accounts/{account}" - + "/offers/{offer}\"\373\002\n\023ParameterDefinition\022" - + "\014\n\004name\030\001 \001(\t\022R\n\016parameter_type\030\002 \001(\0162:." - + "google.cloud.channel.v1.ParameterDefinit" - + "ion.ParameterType\0221\n\tmin_value\030\003 \001(\0132\036.g" - + "oogle.cloud.channel.v1.Value\0221\n\tmax_valu" - + "e\030\004 \001(\0132\036.google.cloud.channel.v1.Value\022" - + "6\n\016allowed_values\030\005 \003(\0132\036.google.cloud.c" - + "hannel.v1.Value\022\020\n\010optional\030\006 \001(\010\"R\n\rPar" - + "ameterType\022\036\n\032PARAMETER_TYPE_UNSPECIFIED" - + "\020\000\022\t\n\005INT64\020\001\022\n\n\006STRING\020\002\022\n\n\006DOUBLE\020\003\"Y\n" - + "\013Constraints\022J\n\024customer_constraints\030\001 \001" - + "(\0132,.google.cloud.channel.v1.CustomerCon" - + "straints\"\327\001\n\023CustomerConstraints\022\027\n\017allo" - + "wed_regions\030\001 \003(\t\022W\n\026allowed_customer_ty" - + "pes\030\002 \003(\01627.google.cloud.channel.v1.Clou" - + "dIdentityInfo.CustomerType\022N\n\027promotiona" - + "l_order_types\030\003 \003(\0162-.google.cloud.chann" - + "el.v1.PromotionalOrderType\"\206\002\n\004Plan\022:\n\014p" - + "ayment_plan\030\001 \001(\0162$.google.cloud.channel" - + ".v1.PaymentPlan\022:\n\014payment_type\030\002 \001(\0162$." - + "google.cloud.channel.v1.PaymentType\0226\n\rp" - + "ayment_cycle\030\003 \001(\0132\037.google.cloud.channe" - + "l.v1.Period\0225\n\014trial_period\030\004 \001(\0132\037.goog" - + "le.cloud.channel.v1.Period\022\027\n\017billing_ac" - + "count\030\005 \001(\t\"\271\001\n\017PriceByResource\022<\n\rresou" - + "rce_type\030\001 \001(\0162%.google.cloud.channel.v1" - + ".ResourceType\022-\n\005price\030\002 \001(\0132\036.google.cl" - + "oud.channel.v1.Price\0229\n\014price_phases\030\003 \003" - + "(\0132#.google.cloud.channel.v1.PricePhase\"" - + "\212\001\n\005Price\022&\n\nbase_price\030\001 \001(\0132\022.google.t" - + "ype.Money\022\020\n\010discount\030\002 \001(\001\022+\n\017effective" - + "_price\030\003 \001(\0132\022.google.type.Money\022\032\n\022exte" - + "rnal_price_uri\030\004 \001(\t\"\331\001\n\nPricePhase\0228\n\013p" - + "eriod_type\030\001 \001(\0162#.google.cloud.channel." - + "v1.PeriodType\022\024\n\014first_period\030\002 \001(\005\022\023\n\013l" - + "ast_period\030\003 \001(\005\022-\n\005price\030\004 \001(\0132\036.google" - + ".cloud.channel.v1.Price\0227\n\013price_tiers\030\005" - + " \003(\0132\".google.cloud.channel.v1.PriceTier" - + "\"i\n\tPriceTier\022\026\n\016first_resource\030\001 \001(\005\022\025\n" - + "\rlast_resource\030\002 \001(\005\022-\n\005price\030\003 \001(\0132\036.go" - + "ogle.cloud.channel.v1.Price\"T\n\006Period\022\020\n" - + "\010duration\030\001 \001(\005\0228\n\013period_type\030\002 \001(\0162#.g" - + "oogle.cloud.channel.v1.PeriodType*m\n\024Pro" - + "motionalOrderType\022 \n\034PROMOTIONAL_TYPE_UN" - + "SPECIFIED\020\000\022\017\n\013NEW_UPGRADE\020\001\022\014\n\010TRANSFER" - + "\020\002\022\024\n\020PROMOTION_SWITCH\020\003*k\n\013PaymentPlan\022" - + "\034\n\030PAYMENT_PLAN_UNSPECIFIED\020\000\022\016\n\nCOMMITM" - + "ENT\020\001\022\014\n\010FLEXIBLE\020\002\022\010\n\004FREE\020\003\022\t\n\005TRIAL\020\004" - + "\022\013\n\007OFFLINE\020\005*D\n\013PaymentType\022\034\n\030PAYMENT_" - + "TYPE_UNSPECIFIED\020\000\022\n\n\006PREPAY\020\001\022\013\n\007POSTPA" - + "Y\020\002*\212\001\n\014ResourceType\022\035\n\031RESOURCE_TYPE_UN" - + "SPECIFIED\020\000\022\010\n\004SEAT\020\001\022\007\n\003MAU\020\002\022\006\n\002GB\020\003\022\021" - + "\n\rLICENSED_USER\020\004\022\013\n\007MINUTES\020\005\022\016\n\nIAAS_U" - + "SAGE\020\006\022\020\n\014SUBSCRIPTION\020\007*G\n\nPeriodType\022\033" - + "\n\027PERIOD_TYPE_UNSPECIFIED\020\000\022\007\n\003DAY\020\001\022\t\n\005" - + "MONTH\020\002\022\010\n\004YEAR\020\003Bl\n\033com.google.cloud.ch" - + "annel.v1B\013OffersProtoP\001Z>google.golang.o" - + "rg/genproto/googleapis/cloud/channel/v1;" - + "channelb\006proto3" + + ".ParameterDefinition\022\021\n\tdeal_code\030\014 \001(\t:" + + "I\352AF\n!cloudchannel.googleapis.com/Offer\022" + + "!accounts/{account}/offers/{offer}\"\373\002\n\023P" + + "arameterDefinition\022\014\n\004name\030\001 \001(\t\022R\n\016para" + + "meter_type\030\002 \001(\0162:.google.cloud.channel." + + "v1.ParameterDefinition.ParameterType\0221\n\t" + + "min_value\030\003 \001(\0132\036.google.cloud.channel.v" + + "1.Value\0221\n\tmax_value\030\004 \001(\0132\036.google.clou" + + "d.channel.v1.Value\0226\n\016allowed_values\030\005 \003" + + "(\0132\036.google.cloud.channel.v1.Value\022\020\n\010op" + + "tional\030\006 \001(\010\"R\n\rParameterType\022\036\n\032PARAMET" + + "ER_TYPE_UNSPECIFIED\020\000\022\t\n\005INT64\020\001\022\n\n\006STRI" + + "NG\020\002\022\n\n\006DOUBLE\020\003\"Y\n\013Constraints\022J\n\024custo" + + "mer_constraints\030\001 \001(\0132,.google.cloud.cha" + + "nnel.v1.CustomerConstraints\"\327\001\n\023Customer" + + "Constraints\022\027\n\017allowed_regions\030\001 \003(\t\022W\n\026" + + "allowed_customer_types\030\002 \003(\01627.google.cl" + + "oud.channel.v1.CloudIdentityInfo.Custome" + + "rType\022N\n\027promotional_order_types\030\003 \003(\0162-" + + ".google.cloud.channel.v1.PromotionalOrde" + + "rType\"\206\002\n\004Plan\022:\n\014payment_plan\030\001 \001(\0162$.g" + + "oogle.cloud.channel.v1.PaymentPlan\022:\n\014pa" + + "yment_type\030\002 \001(\0162$.google.cloud.channel." + + "v1.PaymentType\0226\n\rpayment_cycle\030\003 \001(\0132\037." + + "google.cloud.channel.v1.Period\0225\n\014trial_" + + "period\030\004 \001(\0132\037.google.cloud.channel.v1.P" + + "eriod\022\027\n\017billing_account\030\005 \001(\t\"\271\001\n\017Price" + + "ByResource\022<\n\rresource_type\030\001 \001(\0162%.goog" + + "le.cloud.channel.v1.ResourceType\022-\n\005pric" + + "e\030\002 \001(\0132\036.google.cloud.channel.v1.Price\022" + + "9\n\014price_phases\030\003 \003(\0132#.google.cloud.cha" + + "nnel.v1.PricePhase\"\212\001\n\005Price\022&\n\nbase_pri" + + "ce\030\001 \001(\0132\022.google.type.Money\022\020\n\010discount" + + "\030\002 \001(\001\022+\n\017effective_price\030\003 \001(\0132\022.google" + + ".type.Money\022\032\n\022external_price_uri\030\004 \001(\t\"" + + "\331\001\n\nPricePhase\0228\n\013period_type\030\001 \001(\0162#.go" + + "ogle.cloud.channel.v1.PeriodType\022\024\n\014firs" + + "t_period\030\002 \001(\005\022\023\n\013last_period\030\003 \001(\005\022-\n\005p" + + "rice\030\004 \001(\0132\036.google.cloud.channel.v1.Pri" + + "ce\0227\n\013price_tiers\030\005 \003(\0132\".google.cloud.c" + + "hannel.v1.PriceTier\"i\n\tPriceTier\022\026\n\016firs" + + "t_resource\030\001 \001(\005\022\025\n\rlast_resource\030\002 \001(\005\022" + + "-\n\005price\030\003 \001(\0132\036.google.cloud.channel.v1" + + ".Price\"T\n\006Period\022\020\n\010duration\030\001 \001(\005\0228\n\013pe" + + "riod_type\030\002 \001(\0162#.google.cloud.channel.v" + + "1.PeriodType*m\n\024PromotionalOrderType\022 \n\034" + + "PROMOTIONAL_TYPE_UNSPECIFIED\020\000\022\017\n\013NEW_UP" + + "GRADE\020\001\022\014\n\010TRANSFER\020\002\022\024\n\020PROMOTION_SWITC" + + "H\020\003*k\n\013PaymentPlan\022\034\n\030PAYMENT_PLAN_UNSPE" + + "CIFIED\020\000\022\016\n\nCOMMITMENT\020\001\022\014\n\010FLEXIBLE\020\002\022\010" + + "\n\004FREE\020\003\022\t\n\005TRIAL\020\004\022\013\n\007OFFLINE\020\005*D\n\013Paym" + + "entType\022\034\n\030PAYMENT_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006PREPAY\020\001\022\013\n\007POSTPAY\020\002*\212\001\n\014ResourceType\022" + + "\035\n\031RESOURCE_TYPE_UNSPECIFIED\020\000\022\010\n\004SEAT\020\001" + + "\022\007\n\003MAU\020\002\022\006\n\002GB\020\003\022\021\n\rLICENSED_USER\020\004\022\013\n\007" + + "MINUTES\020\005\022\016\n\nIAAS_USAGE\020\006\022\020\n\014SUBSCRIPTIO" + + "N\020\007*G\n\nPeriodType\022\033\n\027PERIOD_TYPE_UNSPECI" + + "FIED\020\000\022\007\n\003DAY\020\001\022\t\n\005MONTH\020\002\022\010\n\004YEAR\020\003Bl\n\033" + + "com.google.cloud.channel.v1B\013OffersProto" + + "P\001Z>google.golang.org/genproto/googleapi" + + "s/cloud/channel/v1;channelb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -182,6 +182,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "StartTime", "EndTime", "ParameterDefinitions", + "DealCode", }); internal_static_google_cloud_channel_v1_ParameterDefinition_descriptor = getDescriptor().getMessageTypes().get(1); diff --git a/java-channel/proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/offers.proto b/java-channel/proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/offers.proto index 615e3d932e28..ebe698e1f54d 100644 --- a/java-channel/proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/offers.proto +++ b/java-channel/proto-google-cloud-channel-v1/src/main/proto/google/cloud/channel/v1/offers.proto @@ -160,6 +160,9 @@ message Offer { // Parameters required to use current Offer to purchase. repeated ParameterDefinition parameter_definitions = 9; + + // The deal code of the offer to get a special promotion or discount. + string deal_code = 12; } // Parameter's definition. Specifies what parameter is required to use the