Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/retail/v2/user_event.proto
package com.google.cloud.retail.v2;
/**
*
*
*
* A transaction represents the entire purchase transaction.
*
*
* Protobuf type {@code google.cloud.retail.v2.PurchaseTransaction}
*/
public final class PurchaseTransaction extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.retail.v2.PurchaseTransaction)
PurchaseTransactionOrBuilder {
private static final long serialVersionUID = 0L;
// Use PurchaseTransaction.newBuilder() to construct.
private PurchaseTransaction(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PurchaseTransaction() {
id_ = "";
currencyCode_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new PurchaseTransaction();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private PurchaseTransaction(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
id_ = s;
break;
}
case 21:
{
revenue_ = input.readFloat();
break;
}
case 29:
{
tax_ = input.readFloat();
break;
}
case 37:
{
cost_ = input.readFloat();
break;
}
case 42:
{
java.lang.String s = input.readStringRequireUtf8();
currencyCode_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.retail.v2.UserEventProto
.internal_static_google_cloud_retail_v2_PurchaseTransaction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.retail.v2.UserEventProto
.internal_static_google_cloud_retail_v2_PurchaseTransaction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.retail.v2.PurchaseTransaction.class,
com.google.cloud.retail.v2.PurchaseTransaction.Builder.class);
}
public static final int ID_FIELD_NUMBER = 1;
private volatile java.lang.Object id_;
/**
*
*
*
* The transaction ID with a length limit of 128 characters.
*
* The transaction ID with a length limit of 128 characters.
*
*
* string id = 1;
*
* @return The bytes for id.
*/
@java.lang.Override
public com.google.protobuf.ByteString getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REVENUE_FIELD_NUMBER = 2;
private float revenue_;
/**
*
*
*
* Required. Total non-zero revenue or grand total associated with the
* transaction. This value include shipping, tax, or other adjustments to
* total revenue that you want to include as part of your revenue
* calculations.
*
*
* float revenue = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The revenue.
*/
@java.lang.Override
public float getRevenue() {
return revenue_;
}
public static final int TAX_FIELD_NUMBER = 3;
private float tax_;
/**
*
*
*
* All the taxes associated with the transaction.
*
*
* float tax = 3;
*
* @return The tax.
*/
@java.lang.Override
public float getTax() {
return tax_;
}
public static final int COST_FIELD_NUMBER = 4;
private float cost_;
/**
*
*
*
* All the costs associated with the products. These can be manufacturing
* costs, shipping expenses not borne by the end user, or any other costs,
* such that:
* * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
* [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
* [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
*
*
* float cost = 4;
*
* @return The cost.
*/
@java.lang.Override
public float getCost() {
return cost_;
}
public static final int CURRENCY_CODE_FIELD_NUMBER = 5;
private volatile java.lang.Object currencyCode_;
/**
*
*
*
* Required. Currency code. Use three-character ISO-4217 code.
*
* The transaction ID with a length limit of 128 characters.
*
*
* string id = 1;
*
* @return The bytes for id.
*/
public com.google.protobuf.ByteString getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The transaction ID with a length limit of 128 characters.
*
*
* string id = 1;
*
* @param value The id to set.
* @return This builder for chaining.
*/
public Builder setId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
return this;
}
/**
*
*
*
* The transaction ID with a length limit of 128 characters.
*
*
* string id = 1;
*
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
*
*
*
* The transaction ID with a length limit of 128 characters.
*
*
* string id = 1;
*
* @param value The bytes for id to set.
* @return This builder for chaining.
*/
public Builder setIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
id_ = value;
onChanged();
return this;
}
private float revenue_;
/**
*
*
*
* Required. Total non-zero revenue or grand total associated with the
* transaction. This value include shipping, tax, or other adjustments to
* total revenue that you want to include as part of your revenue
* calculations.
*
* Required. Total non-zero revenue or grand total associated with the
* transaction. This value include shipping, tax, or other adjustments to
* total revenue that you want to include as part of your revenue
* calculations.
*
*
* float revenue = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The revenue to set.
* @return This builder for chaining.
*/
public Builder setRevenue(float value) {
revenue_ = value;
onChanged();
return this;
}
/**
*
*
*
* Required. Total non-zero revenue or grand total associated with the
* transaction. This value include shipping, tax, or other adjustments to
* total revenue that you want to include as part of your revenue
* calculations.
*
* All the costs associated with the products. These can be manufacturing
* costs, shipping expenses not borne by the end user, or any other costs,
* such that:
* * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
* [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
* [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
*
* All the costs associated with the products. These can be manufacturing
* costs, shipping expenses not borne by the end user, or any other costs,
* such that:
* * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
* [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
* [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
*
*
* float cost = 4;
*
* @param value The cost to set.
* @return This builder for chaining.
*/
public Builder setCost(float value) {
cost_ = value;
onChanged();
return this;
}
/**
*
*
*
* All the costs associated with the products. These can be manufacturing
* costs, shipping expenses not borne by the end user, or any other costs,
* such that:
* * Profit = [revenue][google.cloud.retail.v2.PurchaseTransaction.revenue] -
* [tax][google.cloud.retail.v2.PurchaseTransaction.tax] -
* [cost][google.cloud.retail.v2.PurchaseTransaction.cost]
*