Beispiel #1
0
        public static PSOrigin ToPsOrigin(this SdkOrigin origin)
        {
            Debug.Assert(origin.ProvisioningState != null, "origin.ProvisioningState != null");
            Debug.Assert(origin.ResourceState != null, "origin.ResourceState != null");

            return(new PSOrigin
            {
                Id = origin.Id,
                Name = origin.Name,
                Type = origin.Type,
                ProvisioningState = (PSProvisioningState)Enum.Parse(typeof(PSProvisioningState), origin.ProvisioningState),
                ResourceState = (PSOriginResourceState)Enum.Parse(typeof(PSOriginResourceState), origin.ResourceState),

                // origin specifc properties
                HostName = origin.HostName,
                HttpPort = origin.HttpPort,
                HttpsPort = origin.HttpsPort,
                OriginHostHeader = origin.OriginHostHeader,
                Priority = origin.Priority,
                PrivateLinkApprovalMessage = origin.PrivateLinkApprovalMessage,
                PrivateLinkLocation = origin.PrivateLinkLocation,
                PrivateLinkResourceId = origin.PrivateLinkResourceId,
                Weight = origin.Weight
            });
        }
Beispiel #2
0
        public static PSOrigin ToPsOrigin(this SdkOrigin origin)
        {
            Debug.Assert(origin.ProvisioningState != null, "origin.ProvisioningState != null");
            Debug.Assert(origin.ResourceState != null, "origin.ResourceState != null");

            return(new PSOrigin
            {
                Id = origin.Id,
                Name = origin.Name,
                Type = origin.Type,
                ProvisioningState = (PSProvisioningState)Enum.Parse(typeof(PSProvisioningState), origin.ProvisioningState),
                ResourceState = (PSOriginResourceState)Enum.Parse(typeof(PSOriginResourceState), origin.ResourceState),
                HostName = origin.HostName,
                HttpPort = origin.HttpPort,
                HttpsPort = origin.HttpsPort
            });
        }
Beispiel #3
0
        public static PSOrigin ToPsOrigin(this SdkOrigin origin)
        {
            Debug.Assert(origin.ProvisioningState != null, "origin.ProvisioningState != null");
            Debug.Assert(origin.ResourceState != null, "origin.ResourceState != null");

            return(new PSOrigin
            {
                Id = origin.Id,
                Name = origin.Name,
                Type = origin.Type,
                ProvisioningState = origin.ProvisioningState.Value.CastEnum <SdkProvisioningState, PSProvisioningState>(),
                ResourceState = origin.ResourceState.Value.CastEnum <SdkOriginResourceState, PSOriginResourceState>(),

                HostName = origin.HostName,
                HttpPort = origin.HttpPort,
                HttpsPort = origin.HttpsPort
            });
        }