|
| 1 | +/* |
| 2 | + * CyberSource Merged Spec |
| 3 | + * |
| 4 | + * All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html |
| 5 | + * |
| 6 | + * OpenAPI spec version: 0.0.1 |
| 7 | + * |
| 8 | + * Generated by: https://github.com/swagger-api/swagger-codegen.git |
| 9 | + */ |
| 10 | + |
| 11 | +using System; |
| 12 | +using System.Linq; |
| 13 | +using System.IO; |
| 14 | +using System.Text; |
| 15 | +using System.Text.RegularExpressions; |
| 16 | +using System.Collections; |
| 17 | +using System.Collections.Generic; |
| 18 | +using System.Collections.ObjectModel; |
| 19 | +using System.Runtime.Serialization; |
| 20 | +using Newtonsoft.Json; |
| 21 | +using Newtonsoft.Json.Converters; |
| 22 | +using System.ComponentModel.DataAnnotations; |
| 23 | +using SwaggerDateConverter = CyberSource.Client.SwaggerDateConverter; |
| 24 | + |
| 25 | +namespace CyberSource.Model |
| 26 | +{ |
| 27 | + /// <summary> |
| 28 | + /// key information |
| 29 | + /// </summary> |
| 30 | + [DataContract] |
| 31 | + public partial class Kmsv2keyssymverifiKeyInformation : IEquatable<Kmsv2keyssymverifiKeyInformation>, IValidatableObject |
| 32 | + { |
| 33 | + /// <summary> |
| 34 | + /// Algorithm for message signature authentication |
| 35 | + /// </summary> |
| 36 | + /// <value>Algorithm for message signature authentication </value> |
| 37 | + [JsonConverter(typeof(StringEnumConverter))] |
| 38 | + public enum DigestAlgorithmEnum |
| 39 | + { |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// Enum HMACSHA1 for "HMACSHA1" |
| 43 | + /// </summary> |
| 44 | + [EnumMember(Value = "HMACSHA1")] |
| 45 | + HMACSHA1, |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Enum HMACSHA2 for "HMACSHA2" |
| 49 | + /// </summary> |
| 50 | + [EnumMember(Value = "HMACSHA2")] |
| 51 | + HMACSHA2 |
| 52 | + } |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// Algorithm for message signature authentication |
| 56 | + /// </summary> |
| 57 | + /// <value>Algorithm for message signature authentication </value> |
| 58 | + [DataMember(Name="digestAlgorithm", EmitDefaultValue=false)] |
| 59 | + public DigestAlgorithmEnum? DigestAlgorithm { get; set; } |
| 60 | + /// <summary> |
| 61 | + /// Initializes a new instance of the <see cref="Kmsv2keyssymverifiKeyInformation" /> class. |
| 62 | + /// </summary> |
| 63 | + [JsonConstructorAttribute] |
| 64 | + protected Kmsv2keyssymverifiKeyInformation() { } |
| 65 | + /// <summary> |
| 66 | + /// Initializes a new instance of the <see cref="Kmsv2keyssymverifiKeyInformation" /> class. |
| 67 | + /// </summary> |
| 68 | + /// <param name="OrganizationId">Merchant Id (required).</param> |
| 69 | + /// <param name="ReferenceNumber">Reference number is a unique identifier provided by the client along with the organization Id. This is an optional field provided solely for the client’s convenience. If client specifies value for this field in the request, it is expected to be available in the response. .</param> |
| 70 | + /// <param name="DigestAlgorithm">Algorithm for message signature authentication (default to DigestAlgorithmEnum.HMACSHA2).</param> |
| 71 | + public Kmsv2keyssymverifiKeyInformation(string OrganizationId = default(string), string ReferenceNumber = default(string), DigestAlgorithmEnum? DigestAlgorithm = DigestAlgorithmEnum.HMACSHA2) |
| 72 | + { |
| 73 | + // to ensure "OrganizationId" is required (not null) |
| 74 | + if (OrganizationId == null) |
| 75 | + { |
| 76 | + throw new InvalidDataException("OrganizationId is a required property for Kmsv2keyssymverifiKeyInformation and cannot be null"); |
| 77 | + } |
| 78 | + else |
| 79 | + { |
| 80 | + this.OrganizationId = OrganizationId; |
| 81 | + } |
| 82 | + this.ReferenceNumber = ReferenceNumber; |
| 83 | + // use default value if no "DigestAlgorithm" provided |
| 84 | + if (DigestAlgorithm == null) |
| 85 | + { |
| 86 | + this.DigestAlgorithm = DigestAlgorithmEnum.HMACSHA2; |
| 87 | + } |
| 88 | + else |
| 89 | + { |
| 90 | + this.DigestAlgorithm = DigestAlgorithm; |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + /// <summary> |
| 95 | + /// Merchant Id |
| 96 | + /// </summary> |
| 97 | + /// <value>Merchant Id </value> |
| 98 | + [DataMember(Name="organizationId", EmitDefaultValue=false)] |
| 99 | + public string OrganizationId { get; set; } |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// Reference number is a unique identifier provided by the client along with the organization Id. This is an optional field provided solely for the client’s convenience. If client specifies value for this field in the request, it is expected to be available in the response. |
| 103 | + /// </summary> |
| 104 | + /// <value>Reference number is a unique identifier provided by the client along with the organization Id. This is an optional field provided solely for the client’s convenience. If client specifies value for this field in the request, it is expected to be available in the response. </value> |
| 105 | + [DataMember(Name="referenceNumber", EmitDefaultValue=false)] |
| 106 | + public string ReferenceNumber { get; set; } |
| 107 | + |
| 108 | + |
| 109 | + /// <summary> |
| 110 | + /// Returns the string presentation of the object |
| 111 | + /// </summary> |
| 112 | + /// <returns>String presentation of the object</returns> |
| 113 | + public override string ToString() |
| 114 | + { |
| 115 | + var sb = new StringBuilder(); |
| 116 | + sb.Append("class Kmsv2keyssymverifiKeyInformation {\n"); |
| 117 | + sb.Append(" OrganizationId: ").Append(OrganizationId).Append("\n"); |
| 118 | + sb.Append(" ReferenceNumber: ").Append(ReferenceNumber).Append("\n"); |
| 119 | + sb.Append(" DigestAlgorithm: ").Append(DigestAlgorithm).Append("\n"); |
| 120 | + sb.Append("}\n"); |
| 121 | + return sb.ToString(); |
| 122 | + } |
| 123 | + |
| 124 | + /// <summary> |
| 125 | + /// Returns the JSON string presentation of the object |
| 126 | + /// </summary> |
| 127 | + /// <returns>JSON string presentation of the object</returns> |
| 128 | + public string ToJson() |
| 129 | + { |
| 130 | + return JsonConvert.SerializeObject(this, Formatting.Indented); |
| 131 | + } |
| 132 | + |
| 133 | + /// <summary> |
| 134 | + /// Returns true if objects are equal |
| 135 | + /// </summary> |
| 136 | + /// <param name="obj">Object to be compared</param> |
| 137 | + /// <returns>Boolean</returns> |
| 138 | + public override bool Equals(object obj) |
| 139 | + { |
| 140 | + // credit: http://stackoverflow.com/a/10454552/677735 |
| 141 | + return this.Equals(obj as Kmsv2keyssymverifiKeyInformation); |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> |
| 145 | + /// Returns true if Kmsv2keyssymverifiKeyInformation instances are equal |
| 146 | + /// </summary> |
| 147 | + /// <param name="other">Instance of Kmsv2keyssymverifiKeyInformation to be compared</param> |
| 148 | + /// <returns>Boolean</returns> |
| 149 | + public bool Equals(Kmsv2keyssymverifiKeyInformation other) |
| 150 | + { |
| 151 | + // credit: http://stackoverflow.com/a/10454552/677735 |
| 152 | + if (other == null) |
| 153 | + return false; |
| 154 | + |
| 155 | + return |
| 156 | + ( |
| 157 | + this.OrganizationId == other.OrganizationId || |
| 158 | + this.OrganizationId != null && |
| 159 | + this.OrganizationId.Equals(other.OrganizationId) |
| 160 | + ) && |
| 161 | + ( |
| 162 | + this.ReferenceNumber == other.ReferenceNumber || |
| 163 | + this.ReferenceNumber != null && |
| 164 | + this.ReferenceNumber.Equals(other.ReferenceNumber) |
| 165 | + ) && |
| 166 | + ( |
| 167 | + this.DigestAlgorithm == other.DigestAlgorithm || |
| 168 | + this.DigestAlgorithm != null && |
| 169 | + this.DigestAlgorithm.Equals(other.DigestAlgorithm) |
| 170 | + ); |
| 171 | + } |
| 172 | + |
| 173 | + /// <summary> |
| 174 | + /// Gets the hash code |
| 175 | + /// </summary> |
| 176 | + /// <returns>Hash code</returns> |
| 177 | + public override int GetHashCode() |
| 178 | + { |
| 179 | + // credit: http://stackoverflow.com/a/263416/677735 |
| 180 | + unchecked // Overflow is fine, just wrap |
| 181 | + { |
| 182 | + int hash = 41; |
| 183 | + // Suitable nullity checks etc, of course :) |
| 184 | + if (this.OrganizationId != null) |
| 185 | + hash = hash * 59 + this.OrganizationId.GetHashCode(); |
| 186 | + if (this.ReferenceNumber != null) |
| 187 | + hash = hash * 59 + this.ReferenceNumber.GetHashCode(); |
| 188 | + if (this.DigestAlgorithm != null) |
| 189 | + hash = hash * 59 + this.DigestAlgorithm.GetHashCode(); |
| 190 | + return hash; |
| 191 | + } |
| 192 | + } |
| 193 | + |
| 194 | + /// <summary> |
| 195 | + /// To validate all properties of the instance |
| 196 | + /// </summary> |
| 197 | + /// <param name="validationContext">Validation context</param> |
| 198 | + /// <returns>Validation Result</returns> |
| 199 | + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) |
| 200 | + { |
| 201 | + yield break; |
| 202 | + } |
| 203 | + } |
| 204 | + |
| 205 | +} |
0 commit comments