Exemplo n.º 1
0
        /// <summary>
        /// The put new InputObject.
        /// </summary>
        /// <param name="newPeering">
        /// The new InputObject.
        /// </param>
        /// <returns>
        /// The <see cref="PSPeerAsn"/>.
        /// </returns>
        private PSPeerAsn PutPeerInfo(PSPeerAsn psPeerInfo)
        {
            var peerInfo = this.PeeringManagementClient.PeerAsns.CreateOrUpdate(
                this.Name,
                PeeringResourceManagerProfile.Mapper.Map <PeerAsn>(psPeerInfo));

            return(PeeringResourceManagerProfile.Mapper.Map <PSPeerAsn>(peerInfo));
        }
Exemplo n.º 2
0
        /// <summary>
        /// The create direct peering.
        /// </summary>
        /// <returns>
        /// The <see cref="PSPeering"/>.
        /// </returns>
        /// <exception cref="PSArgumentNullException">
        /// </exception>
        /// <exception cref="PSArgumentException">
        /// </exception>
        /// <exception cref="Exception">
        /// </exception>
        /// <exception cref="ArmErrorException">
        /// </exception>
        /// <exception cref="HttpRequestException">
        /// </exception>
        private PSPeerAsn CreatePeerInfo()
        {
            var peerInfo = new PSPeerAsn(
                peerAsnProperty: this.PeerAsn,
                peerContactDetail: this.ContactDetail,
                peerName: this.PeerName,
                name: this.Name);

            return(this.PutPeerInfo(peerInfo));
        }
Exemplo n.º 3
0
        /// <summary>
        /// The create direct peering.
        /// </summary>
        /// <returns>
        /// The <see cref="PSPeering"/>.
        /// </returns>
        /// <exception cref="PSArgumentNullException">
        /// </exception>
        /// <exception cref="PSArgumentException">
        /// </exception>
        /// <exception cref="Exception">
        /// </exception>
        /// <exception cref="ArmErrorException">
        /// </exception>
        /// <exception cref="HttpRequestException">
        /// </exception>
        private PSPeerAsn CreatePeerInfo()
        {
            foreach (var s in Email)
            {
                HelperExtensionMethods.IsValidEmail(s);
            }

            var contactInfo = new PSContactInfo(emails: this.Email, phone: this.Phone);
            var peerInfo    = new PSPeerAsn(
                peerAsnProperty: this.PeerAsn,
                peerContactInfo: contactInfo,
                peerName: this.PeerName,
                name: this.Name);

            return(this.PutPeerInfo(peerInfo));
        }