syntax = "proto3";
import "../../users/User.proto";
message TenantAddress {
string street = 1;
string number = 2;
string postcode = 3;
string city = 4;
string country = 5;
}
enum CurrencyType {
EUR = 0;
USD = 1;
CHF = 2;
GBP = 3;
}
message PaymentDetails {
string type = 1;
string cardHolder = 2;
string cardType = 3;
string cardNumberLastFourDigits = 4;
int32 cardExpiryMonth = 5;
int32 cardExpiryYear = 6;
int32 nextBilling = 7;
}
message SubscriptionStatus {
bool isTrial = 1;
string plan = 2;
string chargebeeCustomerID = 3;
string chargebeeSubscriptionID = 4;
PaymentDetails payment = 5;
bool isCancelled = 6;
int32 cancellationTimestamp = 7;
int32 trialExpirationTimestamp = 8;
}
const int32 InfinityLimit = 1000000;
enum LimitIndexes {
users = 0;
persons = 1;
organizations = 2;
pipelines = 3;
pipelineStages = 4;
deals = 5;
customFields = 6;
contactViews = 7;
inboundSources = 8;
drafts = 9;
nylas = 10;
}
message PlanLimits {
int32 users = 1;
int32 persons = 2;
int32 organizations = 3;
int32 pipelines = 4;
int32 pipelineStages = 5;
int32 deals = 6;
int32 customFields = 7;
int32 contactViews = 8;
int32 inboundSources = 9;
int32 drafts = 10;
bool nylas = 11;
}
message UtmData {
string utm_source = 1;
string utm_medium = 2;
string utm_campaign = 3;
string p = 4;
string plan = 5;
}
message Goals {
string surveyrole = 1;
string surveysalestools = 2;
string surveyfrom = 3;
}
message Work {
string surveyindustry = 1;
string surveychangecrm = 2;
string surveyamountusers = 3;
string surveyamountsalesusers = 4;
}
message SignupSurveyInterface {
string _tenantID = 1;
string _userID = 2;
string chargebeeCustomerID = 3;
string chargebeeSubscriptionID = 4;
message About {
string companyName = 1;
message Phone {
string internationalNumber = 1;
}
string website = 3;
}
Goals goals = 5;
Work work = 6;
UtmData utm = 7;
}
message Tenant {
string _id = 1;
string name = 2;
string logo = 3;
CurrencyType currency = 4;
SubscriptionStatus status = 5;
TenantAddress address = 6;
TenantAddress billingAddress = 7;
string website = 8;
string partner = 9;
Work work = 10;
Goals goals = 11;
UtmData utm = 12;
User firstUserData = 13;
int32 createdAt = 14;
int32 updatedAt = 15;
}
If the goals object can be a string, an object, or null, you can define it as a oneof in the proto3 file. Here's an example of how you can define the Goals message in the proto3 file:
syntax = "proto3";
import "../../users/User.proto";
message TenantAddress {
string street = 1;
string number = 2;
string postcode = 3;
string city = 4;
string country = 5;
}
enum CurrencyType {
EUR = 0;
USD = 1;
CHF = 2;
GBP = 3;
}
message PaymentDetails {
string type = 1;
string cardHolder = 2;
string cardType = 3;
string cardNumberLastFourDigits = 4;
int32 cardExpiryMonth = 5;
int32 cardExpiryYear = 6;
int32 nextBilling = 7;
}
message SubscriptionStatus {
bool isTrial = 1;
string plan = 2;
string chargebeeCustomerID = 3;
string chargebeeSubscriptionID = 4;
PaymentDetails payment = 5;
bool isCancelled = 6;
int32 cancellationTimestamp = 7;
int32 trialExpirationTimestamp = 8;
}
const int32 InfinityLimit = 1000000;
enum LimitIndexes {
users = 0;
persons = 1;
organizations = 2;
pipelines = 3;
pipelineStages = 4;
deals = 5;
customFields = 6;
contactViews = 7;
inboundSources = 8;
drafts = 9;
nylas = 10;
}
message PlanLimits {
int32 users = 1;
int32 persons = 2;
int32 organizations = 3;
int32 pipelines = 4;
int32 pipelineStages = 5;
int32 deals = 6;
int32 customFields = 7;
int32 contactViews = 8;
int32 inboundSources = 9;
int32 drafts = 10;
bool nylas = 11;
}
message UtmData {
string utm_source = 1;
string utm_medium = 2;
string utm_campaign = 3;
string p = 4;
string plan = 5;
}
message GoalString {
string goal = 1;
}
message GoalObject {
map<string, string> properties = 2;
}
message Goals {
oneof goal_type {
GoalString goal_string = 1;
GoalObject goal_object = 2;
}
}
message Work {
string surveyindustry = 1;
string surveychangecrm = 2;
string surveyamountusers = 3;
string surveyamountsalesusers = 4;
}
message SignupSurveyInterface {
string _tenantID = 1;
string _userID = 2;
string chargebeeCustomerID = 3;
string chargebeeSubscriptionID = 4;
message About {
string companyName = 1;
message Phone {
string internationalNumber = 1;
}
string website = 3;
}
Goals goals = 5;
Work work = 6;
UtmData utm = 7;
}
message Tenant {
string _id = 1;
string name = 2;
string logo = 3;
CurrencyType currency = 4;
SubscriptionStatus status = 5;
TenantAddress address = 6;
TenantAddress billingAddress = 7;
string website = 8;
string partner = 9;
Work work = 10;
Goals goals = 11;
UtmData utm = 12;
User firstUserData = 13;
int32 createdAt = 14;
int32 updatedAt = 15;
}
In this example, the Goals message has a oneof field called goal_type which can either be a GoalString message (for a string value) or a GoalObject message (for an object). This allows you to handle different types of goals in your data.
If the goals object can be a string, an object, or null, you can define it as a oneof in the proto3 file with a string field and a nested message for the object. Here's an example of how you can define the Goals message in the proto3 file:
syntax = "proto3";
import "../../users/User.proto";
message TenantAddress {
string street = 1;
string number = 2;
string postcode = 3;
string city = 4;
string country = 5;
}
enum CurrencyType {
EUR = 0;
USD = 1;
CHF = 2;
GBP = 3;
}
message PaymentDetails {
string type = 1;
string cardHolder = 2;
string cardType = 3;
string cardNumberLastFourDigits = 4;
int32 cardExpiryMonth = 5;
int32 cardExpiryYear = 6;
int32 nextBilling = 7;
}
message SubscriptionStatus {
bool isTrial = 1;
string plan = 2;
string chargebeeCustomerID = 3;
string chargebeeSubscriptionID = 4;
PaymentDetails payment = 5;
bool isCancelled = 6;
int32 cancellationTimestamp = 7;
int32 trialExpirationTimestamp = 8;
}
const int32 InfinityLimit = 1000000;
enum LimitIndexes {
users = 0;
persons = 1;
organizations = 2;
pipelines = 3;
pipelineStages = 4;
deals = 5;
customFields = 6;
contactViews = 7;
inboundSources = 8;
drafts = 9;
nylas = 10;
}
message PlanLimits {
int32 users = 1;
int32 persons = 2;
int32 organizations = 3;
int32 pipelines = 4;
int32 pipelineStages = 5;
int32 deals = 6;
int32 customFields = 7;
int32 contactViews = 8;
int32 inboundSources = 9;
int32 drafts = 10;
bool nylas = 11;
}
message UtmData {
string utm_source = 1;
string utm_medium = 2;
string utm_campaign = 3;
string p = 4;
string plan = 5;
}
message GoalObject {
string surveyrole = 1;
string surveysalestools = 2;
string surveyfrom = 3;
}
message Goals {
oneof goal_type {
string goal_string = 1;
GoalObject goal_object = 2;
}
}
message Work {
string surveyindustry = 1;
string surveychangecrm = 2;
string surveyamountusers = 3;
string surveyamountsalesusers = 4;
}
message SignupSurveyInterface {
string _tenantID = 1;
string _userID = 2;
string chargebeeCustomerID = 3;
string chargebeeSubscriptionID = 4;
message About {
string companyName = 1;
message Phone {
string internationalNumber = 1;
}
string website = 3;
}
Goals goals = 5;
Work work = 6;
UtmData utm = 7;
}
message Tenant {
string _id = 1;
string name = 2;
string logo = 3;
CurrencyType currency = 4;
SubscriptionStatus status = 5;
TenantAddress address = 6;
TenantAddress billingAddress = 7;
string website = 8;
string partner = 9;
Work work = 10;
Goals goals = 11;
UtmData utm = 12;
User firstUserData = 13;
int32 createdAt = 14;
int32 updatedAt = 15;
}
In this example, the Goals message has a oneof field called goal_type which can either be a string field goal_string or a nested GoalObject message for the object case. This allows you to handle different types of goals in your data, including null values.