|
| 1 | +/* |
| 2 | + * Segment Public API |
| 3 | + * |
| 4 | + * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. |
| 5 | + * |
| 6 | + * The version of the OpenAPI document: 61.1.4 |
| 7 | + * Contact: friends@segment.com |
| 8 | + * Generated by: https://github.com/openapitools/openapi-generator.git |
| 9 | + */ |
| 10 | + |
| 11 | + |
| 12 | +using System; |
| 13 | +using System.Collections; |
| 14 | +using System.Collections.Generic; |
| 15 | +using System.Collections.ObjectModel; |
| 16 | +using System.Linq; |
| 17 | +using System.IO; |
| 18 | +using System.Runtime.Serialization; |
| 19 | +using System.Text; |
| 20 | +using System.Text.RegularExpressions; |
| 21 | +using Newtonsoft.Json; |
| 22 | +using Newtonsoft.Json.Converters; |
| 23 | +using Newtonsoft.Json.Linq; |
| 24 | +using System.ComponentModel.DataAnnotations; |
| 25 | +using OpenAPIDateConverter = Segment.PublicApi.Client.OpenAPIDateConverter; |
| 26 | + |
| 27 | +namespace Segment.PublicApi.Model |
| 28 | +{ |
| 29 | + /// <summary> |
| 30 | + /// The identifier sync configuration input. |
| 31 | + /// </summary> |
| 32 | + [DataContract(Name = "IDSyncConfigurationInput")] |
| 33 | + public partial class IDSyncConfigurationInput : IEquatable<IDSyncConfigurationInput>, IValidatableObject |
| 34 | + { |
| 35 | + /// <summary> |
| 36 | + /// Initializes a new instance of the <see cref="IDSyncConfigurationInput" /> class. |
| 37 | + /// </summary> |
| 38 | + [JsonConstructorAttribute] |
| 39 | + protected IDSyncConfigurationInput() { } |
| 40 | + /// <summary> |
| 41 | + /// Initializes a new instance of the <see cref="IDSyncConfigurationInput" /> class. |
| 42 | + /// </summary> |
| 43 | + /// <param name="externalId">The external id to sync, for example \"user_id\" or \"email\". (required).</param> |
| 44 | + /// <param name="strategy">The strategy for syncing this identifier. Valid values: \"first\", \"last\", \"all\". (required).</param> |
| 45 | + public IDSyncConfigurationInput(string externalId = default(string), string strategy = default(string)) |
| 46 | + { |
| 47 | + // to ensure "externalId" is required (not null) |
| 48 | + if (externalId == null) |
| 49 | + { |
| 50 | + throw new ArgumentNullException("externalId is a required property for IDSyncConfigurationInput and cannot be null"); |
| 51 | + } |
| 52 | + this.ExternalId = externalId; |
| 53 | + // to ensure "strategy" is required (not null) |
| 54 | + if (strategy == null) |
| 55 | + { |
| 56 | + throw new ArgumentNullException("strategy is a required property for IDSyncConfigurationInput and cannot be null"); |
| 57 | + } |
| 58 | + this.Strategy = strategy; |
| 59 | + } |
| 60 | + |
| 61 | + /// <summary> |
| 62 | + /// The external id to sync, for example \"user_id\" or \"email\". |
| 63 | + /// </summary> |
| 64 | + /// <value>The external id to sync, for example \"user_id\" or \"email\".</value> |
| 65 | + [DataMember(Name = "externalId", IsRequired = true, EmitDefaultValue = true)] |
| 66 | + public string ExternalId { get; set; } |
| 67 | + |
| 68 | + /// <summary> |
| 69 | + /// The strategy for syncing this identifier. Valid values: \"first\", \"last\", \"all\". |
| 70 | + /// </summary> |
| 71 | + /// <value>The strategy for syncing this identifier. Valid values: \"first\", \"last\", \"all\".</value> |
| 72 | + [DataMember(Name = "strategy", IsRequired = true, EmitDefaultValue = true)] |
| 73 | + public string Strategy { get; set; } |
| 74 | + |
| 75 | + /// <summary> |
| 76 | + /// Returns the string presentation of the object |
| 77 | + /// </summary> |
| 78 | + /// <returns>String presentation of the object</returns> |
| 79 | + public override string ToString() |
| 80 | + { |
| 81 | + StringBuilder sb = new StringBuilder(); |
| 82 | + sb.Append("class IDSyncConfigurationInput {\n"); |
| 83 | + sb.Append(" ExternalId: ").Append(ExternalId).Append("\n"); |
| 84 | + sb.Append(" Strategy: ").Append(Strategy).Append("\n"); |
| 85 | + sb.Append("}\n"); |
| 86 | + return sb.ToString(); |
| 87 | + } |
| 88 | + |
| 89 | + /// <summary> |
| 90 | + /// Returns the JSON string presentation of the object |
| 91 | + /// </summary> |
| 92 | + /// <returns>JSON string presentation of the object</returns> |
| 93 | + public virtual string ToJson() |
| 94 | + { |
| 95 | + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); |
| 96 | + } |
| 97 | + |
| 98 | + /// <summary> |
| 99 | + /// Returns true if objects are equal |
| 100 | + /// </summary> |
| 101 | + /// <param name="input">Object to be compared</param> |
| 102 | + /// <returns>Boolean</returns> |
| 103 | + public override bool Equals(object input) |
| 104 | + { |
| 105 | + return this.Equals(input as IDSyncConfigurationInput); |
| 106 | + } |
| 107 | + |
| 108 | + /// <summary> |
| 109 | + /// Returns true if IDSyncConfigurationInput instances are equal |
| 110 | + /// </summary> |
| 111 | + /// <param name="input">Instance of IDSyncConfigurationInput to be compared</param> |
| 112 | + /// <returns>Boolean</returns> |
| 113 | + public bool Equals(IDSyncConfigurationInput input) |
| 114 | + { |
| 115 | + if (input == null) |
| 116 | + { |
| 117 | + return false; |
| 118 | + } |
| 119 | + return |
| 120 | + ( |
| 121 | + this.ExternalId == input.ExternalId || |
| 122 | + (this.ExternalId != null && |
| 123 | + this.ExternalId.Equals(input.ExternalId)) |
| 124 | + ) && |
| 125 | + ( |
| 126 | + this.Strategy == input.Strategy || |
| 127 | + (this.Strategy != null && |
| 128 | + this.Strategy.Equals(input.Strategy)) |
| 129 | + ); |
| 130 | + } |
| 131 | + |
| 132 | + /// <summary> |
| 133 | + /// Gets the hash code |
| 134 | + /// </summary> |
| 135 | + /// <returns>Hash code</returns> |
| 136 | + public override int GetHashCode() |
| 137 | + { |
| 138 | + unchecked // Overflow is fine, just wrap |
| 139 | + { |
| 140 | + int hashCode = 41; |
| 141 | + if (this.ExternalId != null) |
| 142 | + { |
| 143 | + hashCode = (hashCode * 59) + this.ExternalId.GetHashCode(); |
| 144 | + } |
| 145 | + if (this.Strategy != null) |
| 146 | + { |
| 147 | + hashCode = (hashCode * 59) + this.Strategy.GetHashCode(); |
| 148 | + } |
| 149 | + return hashCode; |
| 150 | + } |
| 151 | + } |
| 152 | + |
| 153 | + /// <summary> |
| 154 | + /// To validate all properties of the instance |
| 155 | + /// </summary> |
| 156 | + /// <param name="validationContext">Validation context</param> |
| 157 | + /// <returns>Validation Result</returns> |
| 158 | + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) |
| 159 | + { |
| 160 | + yield break; |
| 161 | + } |
| 162 | + } |
| 163 | + |
| 164 | +} |
0 commit comments