/// <summary> /// Return a XML representation of this object. /// </summary> public XElement ToXML() => new XElement(SOAPNS.v1_2.NS.SOAPEnvelope + "Header", new XElement(OCPPNS.OCPPv1_6_CS + "chargeBoxIdentity", ChargeBoxIdentity.ToString()), new XElement(SOAPNS.v1_2.NS.SOAPAdressing + "Action", new XAttribute(SOAPNS.v1_2.NS.SOAPEnvelope + "mustUnderstand", true), Action), new XElement(SOAPNS.v1_2.NS.SOAPAdressing + "MessageID", new XAttribute(SOAPNS.v1_2.NS.SOAPEnvelope + "mustUnderstand", true), MessageId), RelatesTo.IsNotNullOrEmpty() ? new XElement(SOAPNS.v1_2.NS.SOAPAdressing + "RelatesTo", new XAttribute(SOAPNS.v1_2.NS.SOAPEnvelope + "mustUnderstand", true), RelatesTo) : null, new XElement(SOAPNS.v1_2.NS.SOAPAdressing + "From", new XAttribute(SOAPNS.v1_2.NS.SOAPEnvelope + "mustUnderstand", true), From), new XElement(SOAPNS.v1_2.NS.SOAPAdressing + "ReplyTo", new XAttribute(SOAPNS.v1_2.NS.SOAPEnvelope + "mustUnderstand", true), new XElement(SOAPNS.v1_2.NS.SOAPEnvelope + "Address", "http://www.w3.org/2005/08/addressing/anonymous") ), new XElement(SOAPNS.v1_2.NS.SOAPAdressing + "To", new XAttribute(SOAPNS.v1_2.NS.SOAPEnvelope + "mustUnderstand", true), To) );
/// <summary> /// Return the HashCode of this object. /// </summary> /// <returns>The HashCode of this object.</returns> public override Int32 GetHashCode() { unchecked { return(ChargeBoxIdentity.GetHashCode() * 19 ^ Action.GetHashCode() * 17 ^ MessageId.GetHashCode() * 11 ^ (RelatesTo != null ? RelatesTo.GetHashCode() * 7 : 0) ^ From.GetHashCode() * 5 ^ To.GetHashCode()); } }
/// <summary> /// Compares two id tag infos for equality. /// </summary> /// <param name="SOAPHeader">An id tag info to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(SOAPHeader SOAPHeader) { if ((Object)SOAPHeader == null) { return(false); } return(ChargeBoxIdentity.Equals(SOAPHeader.ChargeBoxIdentity) && Action.Equals(SOAPHeader.Action) && MessageId.Equals(SOAPHeader.MessageId) && ((RelatesTo == null && SOAPHeader.RelatesTo == null) || (RelatesTo != null && SOAPHeader.RelatesTo != null && RelatesTo.Equals(SOAPHeader.RelatesTo))) && From.Equals(SOAPHeader.From) && To.Equals(SOAPHeader.To)); }
private PaymentMethod CreateContractPaymentMethod(string epdid, string contractDid, RequestorInformation requestor) { var paymentMethod = new PaymentMethod() { ElectronicPaymentDid = epdid, CreatedBy = "ArBackFill" }; var relatesTo = new RelatesTo() { Did = contractDid, Type = "contract" }; var methodResponse = _tellerApiClient.PostPaymentMethod(paymentMethod, relatesTo, requestor); var responseEpDid = methodResponse.Result.ElectronicPaymentDid; if (responseEpDid != epdid) { return(null); } return(paymentMethod); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DocumentReference; if (dest != null) { base.CopyTo(dest); if (MasterIdentifier != null) { dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (Class != null) { dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); } if (Author != null) { dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy()); } if (Custodian != null) { dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); } if (Authenticator != null) { dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy(); } if (CreatedElement != null) { dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); } if (IndexedElement != null) { dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.DocumentReferenceStatus>)StatusElement.DeepCopy(); } if (DocStatus != null) { dest.DocStatus = (Hl7.Fhir.Model.CodeableConcept)DocStatus.DeepCopy(); } if (RelatesTo != null) { dest.RelatesTo = new List <Hl7.Fhir.Model.DocumentReference.RelatesToComponent>(RelatesTo.DeepCopy()); } if (DescriptionElement != null) { dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); } if (SecurityLabel != null) { dest.SecurityLabel = new List <Hl7.Fhir.Model.CodeableConcept>(SecurityLabel.DeepCopy()); } if (Content != null) { dest.Content = new List <Hl7.Fhir.Model.DocumentReference.ContentComponent>(Content.DeepCopy()); } if (Context != null) { dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public Task <PaymentMethod> PostPaymentMethod(PaymentMethod paymentMethod, RelatesTo relatesTo, RequestorInformation requestorInfo) { var path = $"/v1/{relatesTo.Type}s/{relatesTo.Did}/paymentmethods"; return(PostJsonAsync <PaymentMethod>(path, paymentMethod, requestorInfo)); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (Timestamp != null) { hashCode = hashCode * 59 + Timestamp.GetHashCode(); } if (LocalTimestamp != null) { hashCode = hashCode * 59 + LocalTimestamp.GetHashCode(); } if (ServiceUrl != null) { hashCode = hashCode * 59 + ServiceUrl.GetHashCode(); } if (ChannelId != null) { hashCode = hashCode * 59 + ChannelId.GetHashCode(); } if (From != null) { hashCode = hashCode * 59 + From.GetHashCode(); } if (Conversation != null) { hashCode = hashCode * 59 + Conversation.GetHashCode(); } if (Recipient != null) { hashCode = hashCode * 59 + Recipient.GetHashCode(); } if (TextFormat != null) { hashCode = hashCode * 59 + TextFormat.GetHashCode(); } if (AttachmentLayout != null) { hashCode = hashCode * 59 + AttachmentLayout.GetHashCode(); } if (MembersAdded != null) { hashCode = hashCode * 59 + MembersAdded.GetHashCode(); } if (MembersRemoved != null) { hashCode = hashCode * 59 + MembersRemoved.GetHashCode(); } if (TopicName != null) { hashCode = hashCode * 59 + TopicName.GetHashCode(); } if (HistoryDisclosed != null) { hashCode = hashCode * 59 + HistoryDisclosed.GetHashCode(); } if (Locale != null) { hashCode = hashCode * 59 + Locale.GetHashCode(); } if (Text != null) { hashCode = hashCode * 59 + Text.GetHashCode(); } if (Speak != null) { hashCode = hashCode * 59 + Speak.GetHashCode(); } if (InputHint != null) { hashCode = hashCode * 59 + InputHint.GetHashCode(); } if (Summary != null) { hashCode = hashCode * 59 + Summary.GetHashCode(); } if (SuggestedActions != null) { hashCode = hashCode * 59 + SuggestedActions.GetHashCode(); } if (Attachments != null) { hashCode = hashCode * 59 + Attachments.GetHashCode(); } if (Entities != null) { hashCode = hashCode * 59 + Entities.GetHashCode(); } if (ChannelData != null) { hashCode = hashCode * 59 + ChannelData.GetHashCode(); } if (Action != null) { hashCode = hashCode * 59 + Action.GetHashCode(); } if (ReplyToId != null) { hashCode = hashCode * 59 + ReplyToId.GetHashCode(); } if (Value != null) { hashCode = hashCode * 59 + Value.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (RelatesTo != null) { hashCode = hashCode * 59 + RelatesTo.GetHashCode(); } if (Code != null) { hashCode = hashCode * 59 + Code.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Activity instances are equal /// </summary> /// <param name="other">Instance of Activity to be compared</param> /// <returns>Boolean</returns> public bool Equals(Activity other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Timestamp == other.Timestamp || Timestamp != null && Timestamp.Equals(other.Timestamp) ) && ( LocalTimestamp == other.LocalTimestamp || LocalTimestamp != null && LocalTimestamp.Equals(other.LocalTimestamp) ) && ( ServiceUrl == other.ServiceUrl || ServiceUrl != null && ServiceUrl.Equals(other.ServiceUrl) ) && ( ChannelId == other.ChannelId || ChannelId != null && ChannelId.Equals(other.ChannelId) ) && ( From == other.From || From != null && From.Equals(other.From) ) && ( Conversation == other.Conversation || Conversation != null && Conversation.Equals(other.Conversation) ) && ( Recipient == other.Recipient || Recipient != null && Recipient.Equals(other.Recipient) ) && ( TextFormat == other.TextFormat || TextFormat != null && TextFormat.Equals(other.TextFormat) ) && ( AttachmentLayout == other.AttachmentLayout || AttachmentLayout != null && AttachmentLayout.Equals(other.AttachmentLayout) ) && ( MembersAdded == other.MembersAdded || MembersAdded != null && MembersAdded.SequenceEqual(other.MembersAdded) ) && ( MembersRemoved == other.MembersRemoved || MembersRemoved != null && MembersRemoved.SequenceEqual(other.MembersRemoved) ) && ( TopicName == other.TopicName || TopicName != null && TopicName.Equals(other.TopicName) ) && ( HistoryDisclosed == other.HistoryDisclosed || HistoryDisclosed != null && HistoryDisclosed.Equals(other.HistoryDisclosed) ) && ( Locale == other.Locale || Locale != null && Locale.Equals(other.Locale) ) && ( Text == other.Text || Text != null && Text.Equals(other.Text) ) && ( Speak == other.Speak || Speak != null && Speak.Equals(other.Speak) ) && ( InputHint == other.InputHint || InputHint != null && InputHint.Equals(other.InputHint) ) && ( Summary == other.Summary || Summary != null && Summary.Equals(other.Summary) ) && ( SuggestedActions == other.SuggestedActions || SuggestedActions != null && SuggestedActions.Equals(other.SuggestedActions) ) && ( Attachments == other.Attachments || Attachments != null && Attachments.SequenceEqual(other.Attachments) ) && ( Entities == other.Entities || Entities != null && Entities.SequenceEqual(other.Entities) ) && ( ChannelData == other.ChannelData || ChannelData != null && ChannelData.Equals(other.ChannelData) ) && ( Action == other.Action || Action != null && Action.Equals(other.Action) ) && ( ReplyToId == other.ReplyToId || ReplyToId != null && ReplyToId.Equals(other.ReplyToId) ) && ( Value == other.Value || Value != null && Value.Equals(other.Value) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( RelatesTo == other.RelatesTo || RelatesTo != null && RelatesTo.Equals(other.RelatesTo) ) && ( Code == other.Code || Code != null && Code.Equals(other.Code) )); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DocumentReference; if (dest != null) { base.CopyTo(dest); if (MasterIdentifier != null) { dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy(); } if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (Class != null) { dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy(); } if (Author != null) { dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy()); } if (Custodian != null) { dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy(); } if (PolicyManagerElement != null) { dest.PolicyManagerElement = (Hl7.Fhir.Model.FhirUri)PolicyManagerElement.DeepCopy(); } if (Authenticator != null) { dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy(); } if (CreatedElement != null) { dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy(); } if (IndexedElement != null) { dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.DocumentReference.DocumentReferenceStatus>)StatusElement.DeepCopy(); } if (DocStatus != null) { dest.DocStatus = (Hl7.Fhir.Model.CodeableConcept)DocStatus.DeepCopy(); } if (RelatesTo != null) { dest.RelatesTo = new List <Hl7.Fhir.Model.DocumentReference.DocumentReferenceRelatesToComponent>(RelatesTo.DeepCopy()); } if (DescriptionElement != null) { dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy(); } if (Confidentiality != null) { dest.Confidentiality = new List <Hl7.Fhir.Model.CodeableConcept>(Confidentiality.DeepCopy()); } if (PrimaryLanguageElement != null) { dest.PrimaryLanguageElement = (Hl7.Fhir.Model.Code)PrimaryLanguageElement.DeepCopy(); } if (MimeTypeElement != null) { dest.MimeTypeElement = (Hl7.Fhir.Model.Code)MimeTypeElement.DeepCopy(); } if (FormatElement != null) { dest.FormatElement = new List <Hl7.Fhir.Model.FhirUri>(FormatElement.DeepCopy()); } if (SizeElement != null) { dest.SizeElement = (Hl7.Fhir.Model.Integer)SizeElement.DeepCopy(); } if (HashElement != null) { dest.HashElement = (Hl7.Fhir.Model.FhirString)HashElement.DeepCopy(); } if (LocationElement != null) { dest.LocationElement = (Hl7.Fhir.Model.FhirUri)LocationElement.DeepCopy(); } if (Service != null) { dest.Service = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceServiceComponent)Service.DeepCopy(); } if (Context != null) { dest.Context = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceContextComponent)Context.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }