public PropertyContainer(Models.JobManagerTask protocolObject) : base(BindingState.Bound)
 {
     this.AllowLowPriorityNodeProperty = this.CreatePropertyAccessor(
         protocolObject.AllowLowPriorityNode,
         nameof(AllowLowPriorityNode),
         BindingAccess.Read | BindingAccess.Write);
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReferences),
         nameof(ApplicationPackageReferences),
         BindingAccess.Read | BindingAccess.Write);
     this.AuthenticationTokenSettingsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AuthenticationTokenSettings, o => new AuthenticationTokenSettings(o)),
         nameof(AuthenticationTokenSettings),
         BindingAccess.Read | BindingAccess.Write);
     this.CommandLineProperty = this.CreatePropertyAccessor(
         protocolObject.CommandLine,
         nameof(CommandLine),
         BindingAccess.Read | BindingAccess.Write);
     this.ConstraintsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Constraints, o => new TaskConstraints(o)),
         nameof(Constraints),
         BindingAccess.Read | BindingAccess.Write);
     this.ContainerSettingsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ContainerSettings, o => new TaskContainerSettings(o).Freeze()),
         nameof(ContainerSettings),
         BindingAccess.Read);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         nameof(DisplayName),
         BindingAccess.Read | BindingAccess.Write);
     this.EnvironmentSettingsProperty = this.CreatePropertyAccessor(
         EnvironmentSetting.ConvertFromProtocolCollection(protocolObject.EnvironmentSettings),
         nameof(EnvironmentSettings),
         BindingAccess.Read | BindingAccess.Write);
     this.IdProperty = this.CreatePropertyAccessor(
         protocolObject.Id,
         nameof(Id),
         BindingAccess.Read | BindingAccess.Write);
     this.KillJobOnCompletionProperty = this.CreatePropertyAccessor(
         protocolObject.KillJobOnCompletion,
         nameof(KillJobOnCompletion),
         BindingAccess.Read | BindingAccess.Write);
     this.OutputFilesProperty = this.CreatePropertyAccessor(
         OutputFile.ConvertFromProtocolCollection(protocolObject.OutputFiles),
         nameof(OutputFiles),
         BindingAccess.Read | BindingAccess.Write);
     this.ResourceFilesProperty = this.CreatePropertyAccessor(
         ResourceFile.ConvertFromProtocolCollection(protocolObject.ResourceFiles),
         nameof(ResourceFiles),
         BindingAccess.Read | BindingAccess.Write);
     this.RunExclusiveProperty = this.CreatePropertyAccessor(
         protocolObject.RunExclusive,
         nameof(RunExclusive),
         BindingAccess.Read | BindingAccess.Write);
     this.UserIdentityProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.UserIdentity, o => new UserIdentity(o)),
         nameof(UserIdentity),
         BindingAccess.Read | BindingAccess.Write);
 }
 internal PSApplicationPackageReference(Microsoft.Azure.Batch.ApplicationPackageReference omObject)
 {
     if ((omObject == null))
     {
         throw new System.ArgumentNullException("omObject");
     }
     this.omObject = omObject;
 }
 internal PSApplicationPackageReference(Microsoft.Azure.Batch.ApplicationPackageReference omObject)
 {
     if ((omObject == null))
     {
         throw new System.ArgumentNullException("omObject");
     }
     this.omObject = omObject;
 }
        public async Task GetJobScheduleWithApplicationPackageReferences()
        {
            const string applicationId = "app-1";
            const string version       = "1.0";

            BatchSharedKeyCredentials credentials = ClientUnitTestCommon.CreateDummySharedKeyCredential();

            using (BatchClient client = BatchClient.Open(credentials))
            {
                Protocol.RequestInterceptor interceptor = new Protocol.RequestInterceptor(baseRequest =>
                {
                    var request = (Protocol.BatchRequest <Models.JobScheduleGetOptions, AzureOperationResponse <Models.CloudJobSchedule, Models.JobScheduleGetHeaders> >)baseRequest;

                    request.ServiceRequestFunc = (token) =>
                    {
                        var response = new AzureOperationResponse <Models.CloudJobSchedule, Models.JobScheduleGetHeaders>
                        {
                            Body = new Models.CloudJobSchedule
                            {
                                JobSpecification = new Protocol.Models.JobSpecification
                                {
                                    PoolInfo = new Models.PoolInformation
                                    {
                                        AutoPoolSpecification = new Protocol.Models.AutoPoolSpecification
                                        {
                                            Pool = new Models.PoolSpecification
                                            {
                                                ApplicationPackageReferences = new List <Protocol.Models.ApplicationPackageReference>
                                                {
                                                    new Protocol.Models.ApplicationPackageReference
                                                    {
                                                        ApplicationId = applicationId,
                                                        Version       = version
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        };
                        return(Task.FromResult(response));
                    };
                });

                Microsoft.Azure.Batch.CloudJobSchedule jobSchedule = await client.JobScheduleOperations.GetJobScheduleAsync("test", additionalBehaviors : new List <BatchClientBehavior> {
                    interceptor
                });

                Microsoft.Azure.Batch.ApplicationPackageReference apr = jobSchedule.JobSpecification.PoolInformation.AutoPoolSpecification.PoolSpecification.ApplicationPackageReferences.First();

                Assert.Equal(apr.ApplicationId, applicationId);
                Assert.Equal(apr.Version, version);
            }
        }
        public async Task CanCreateJobAndAutoPoolWithAppPackageReferences()
        {
            string jobId = Guid.NewGuid().ToString();

            var poolInformation = new PoolInformation
            {
                AutoPoolSpecification = new AutoPoolSpecification
                {
                    PoolSpecification = new PoolSpecification
                    {
                        ApplicationPackageReferences = new List <ApplicationPackageReference>
                        {
                            new ApplicationPackageReference
                            {
                                ApplicationId = ApplicationId,
                                Version       = Version
                            }
                        },
                        CloudServiceConfiguration = new CloudServiceConfiguration(PoolFixture.OSFamily),
                        VirtualMachineSize        = PoolFixture.VMSize,
                    },
                    PoolLifetimeOption = PoolLifetimeOption.Job
                }
            };

            Func <Task> test = async() =>
            {
                using (BatchClient client = await TestUtilities.OpenBatchClientFromEnvironmentAsync().ConfigureAwait(false))
                {
                    try
                    {
                        var job = client.JobOperations.CreateJob(jobId, poolInformation);

                        await job.CommitAsync().ConfigureAwait(false);

                        CloudJob jobResponse = await client.JobOperations.GetJobAsync(jobId).ConfigureAwait(false);

                        ApplicationPackageReference apr = jobResponse.PoolInformation.AutoPoolSpecification.PoolSpecification.ApplicationPackageReferences.First();

                        Assert.Equal(ApplicationId, apr.ApplicationId);
                        Assert.Equal(Version, apr.Version);
                    }
                    finally
                    {
                        TestUtilities.DeleteJobIfExistsAsync(client, jobId).Wait();
                    }
                }
            };

            await SynchronizationContextHelper.RunTestAsync(test, LongTestTimeout);
        }
Example #6
0
 public PropertyContainer(Models.JobManagerTask protocolObject) : base(BindingState.Bound)
 {
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollectionAndFreeze(protocolObject.ApplicationPackageReferences),
         "ApplicationPackageReferences",
         BindingAccess.Read);
     this.CommandLineProperty = this.CreatePropertyAccessor(
         protocolObject.CommandLine,
         "CommandLine",
         BindingAccess.Read | BindingAccess.Write);
     this.ConstraintsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Constraints, o => new TaskConstraints(o)),
         "Constraints",
         BindingAccess.Read | BindingAccess.Write);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         "DisplayName",
         BindingAccess.Read | BindingAccess.Write);
     this.EnvironmentSettingsProperty = this.CreatePropertyAccessor(
         EnvironmentSetting.ConvertFromProtocolCollection(protocolObject.EnvironmentSettings),
         "EnvironmentSettings",
         BindingAccess.Read | BindingAccess.Write);
     this.IdProperty = this.CreatePropertyAccessor(
         protocolObject.Id,
         "Id",
         BindingAccess.Read | BindingAccess.Write);
     this.KillJobOnCompletionProperty = this.CreatePropertyAccessor(
         protocolObject.KillJobOnCompletion,
         "KillJobOnCompletion",
         BindingAccess.Read | BindingAccess.Write);
     this.ResourceFilesProperty = this.CreatePropertyAccessor(
         ResourceFile.ConvertFromProtocolCollection(protocolObject.ResourceFiles),
         "ResourceFiles",
         BindingAccess.Read | BindingAccess.Write);
     this.RunElevatedProperty = this.CreatePropertyAccessor(
         protocolObject.RunElevated,
         "RunElevated",
         BindingAccess.Read | BindingAccess.Write);
     this.RunExclusiveProperty = this.CreatePropertyAccessor(
         protocolObject.RunExclusive,
         "RunExclusive",
         BindingAccess.Read | BindingAccess.Write);
 }
Example #7
0
        public async Task IfAPoolIsCommittedWithApplicationPackageReferences_ThenThoseReferencesArePersistedInTheService()
        {
            var poolId = "app-ref-test-1-" + Guid.NewGuid();

            async Task test()
            {
                using BatchClient client = await TestUtilities.OpenBatchClientFromEnvironmentAsync();

                CloudPool newPool = null;

                try
                {
                    List <ApplicationSummary> applicationSummaries = await client.ApplicationOperations.ListApplicationSummaries().ToListAsync().ConfigureAwait(false);

                    foreach (var applicationSummary in applicationSummaries.Where(app => app.Id == ApplicationId))
                    {
                        Assert.True(true, string.Format("{0} was found.", applicationSummary.Id));
                    }
                    CloudPool pool = client.PoolOperations.CreatePool(poolId, PoolFixture.VMSize, new CloudServiceConfiguration(PoolFixture.OSFamily));

                    pool.ApplicationPackageReferences = new[] { new ApplicationPackageReference {
                                                                    ApplicationId = ApplicationId, Version = Version
                                                                } };

                    await pool.CommitAsync().ConfigureAwait(false);

                    newPool = await client.PoolOperations.GetPoolAsync(poolId).ConfigureAwait(false);

                    ApplicationPackageReference apr = newPool.ApplicationPackageReferences.First();

                    Assert.Equal(ApplicationId, apr.ApplicationId);
                    Assert.Equal(Version, apr.Version);
                }
                finally
                {
                    TestUtilities.DeletePoolIfExistsAsync(client, poolId).Wait();
                }
            }

            await SynchronizationContextHelper.RunTestAsync(test, LongTestTimeout);
        }
        public async Task UpdateAnExistingPoolWithNewApplicationPackageReferences_AndChecksTheApplicationPackageReferencesIsOnThePool()
        {
            var poolId = "app-ref-test-2-" + Guid.NewGuid();

            Func <Task> test = async() =>
            {
                using (BatchClient client = await TestUtilities.OpenBatchClientFromEnvironmentAsync())
                {
                    try
                    {
                        CloudPool pool = client.PoolOperations.CreatePool(poolId, PoolFixture.VMSize, new CloudServiceConfiguration(PoolFixture.OSFamily));
                        await pool.CommitAsync().ConfigureAwait(false);

                        pool = await client.PoolOperations.GetPoolAsync(poolId).ConfigureAwait(false);

                        Assert.Null(pool.ApplicationPackageReferences);

                        pool.ApplicationPackageReferences = new[] { new ApplicationPackageReference {
                                                                        ApplicationId = ApplicationId, Version = Version
                                                                    } };

                        await pool.CommitAsync().ConfigureAwait(false);

                        CloudPool updatedPool = await client.PoolOperations.GetPoolAsync(poolId).ConfigureAwait(false);

                        ApplicationPackageReference apr = updatedPool.ApplicationPackageReferences.First();

                        Assert.Equal(ApplicationId, apr.ApplicationId);
                        Assert.Equal(Version, apr.Version);
                    }
                    finally
                    {
                        TestUtilities.DeletePoolIfExistsAsync(client, poolId).Wait();
                    }
                }
            };

            await SynchronizationContextHelper.RunTestAsync(test, LongTestTimeout);
        }
Example #9
0
        public async Task CanCreateAndUpdateJobScheduleWithApplicationReferences()
        {
            var jobId = Guid.NewGuid().ToString();

            const string newVersion = "2.0";

            var poolInformation = new PoolInformation
            {
                AutoPoolSpecification = new AutoPoolSpecification
                {
                    PoolSpecification = new PoolSpecification
                    {
                        ApplicationPackageReferences = new List <ApplicationPackageReference>
                        {
                            new ApplicationPackageReference
                            {
                                ApplicationId = ApplicationId,
                                Version       = Version
                            }
                        },
                        CloudServiceConfiguration = new CloudServiceConfiguration(PoolFixture.OSFamily),
                        VirtualMachineSize        = PoolFixture.VMSize,
                    },
                    PoolLifetimeOption = PoolLifetimeOption.JobSchedule,
                    KeepAlive          = false,
                }
            };

            Schedule schedule = new Schedule {
                DoNotRunAfter = DateTime.UtcNow.AddMinutes(5), RecurrenceInterval = TimeSpan.FromMinutes(2)
            };
            JobSpecification jobSpecification = new JobSpecification(poolInformation);

            using BatchClient client = await TestUtilities.OpenBatchClientFromEnvironmentAsync().ConfigureAwait(false);

            CloudJobSchedule cloudJobSchedule = client.JobScheduleOperations.CreateJobSchedule(jobId, schedule, jobSpecification);

            async Task test()
            {
                CloudJobSchedule updatedBoundJobSchedule = null;

                try
                {
                    await cloudJobSchedule.CommitAsync().ConfigureAwait(false);

                    CloudJobSchedule boundJobSchedule = TestUtilities.WaitForJobOnJobSchedule(client.JobScheduleOperations, jobId);

                    ApplicationPackageReference apr = boundJobSchedule.JobSpecification.PoolInformation.AutoPoolSpecification.PoolSpecification.ApplicationPackageReferences.First();

                    Assert.Equal(ApplicationId, apr.ApplicationId);
                    Assert.Equal(Version, apr.Version);

                    boundJobSchedule.JobSpecification.PoolInformation.AutoPoolSpecification.PoolSpecification.ApplicationPackageReferences = new[]
                    {
                        new ApplicationPackageReference()
                        {
                            ApplicationId = ApplicationId,
                            Version       = newVersion
                        }
                    };

                    await boundJobSchedule.CommitAsync().ConfigureAwait(false);

                    await boundJobSchedule.RefreshAsync().ConfigureAwait(false);

                    updatedBoundJobSchedule = await client.JobScheduleOperations.GetJobScheduleAsync(jobId).ConfigureAwait(false);

                    ApplicationPackageReference updatedApr =
                        updatedBoundJobSchedule.JobSpecification.PoolInformation.AutoPoolSpecification.PoolSpecification.ApplicationPackageReferences
                        .First();

                    Assert.Equal(ApplicationId, updatedApr.ApplicationId);
                    Assert.Equal(newVersion, updatedApr.Version);
                }
                finally
                {
                    TestUtilities.DeleteJobScheduleIfExistsAsync(client, jobId).Wait();
                }
            }

            await SynchronizationContextHelper.RunTestAsync(test, LongTestTimeout);
        }
Example #10
0
 public PropertyContainer(Models.CloudPool protocolObject) : base(BindingState.Bound)
 {
     this.AllocationStateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.AllocationState, Common.AllocationState>(protocolObject.AllocationState),
         nameof(AllocationState),
         BindingAccess.Read);
     this.AllocationStateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.AllocationStateTransitionTime,
         nameof(AllocationStateTransitionTime),
         BindingAccess.Read);
     this.ApplicationLicensesProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ApplicationLicenses, o => o),
         nameof(ApplicationLicenses),
         BindingAccess.Read);
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReferences),
         nameof(ApplicationPackageReferences),
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableAutoScale,
         nameof(AutoScaleEnabled),
         BindingAccess.Read);
     this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleEvaluationInterval,
         nameof(AutoScaleEvaluationInterval),
         BindingAccess.Read);
     this.AutoScaleFormulaProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleFormula,
         nameof(AutoScaleFormula),
         BindingAccess.Read);
     this.AutoScaleRunProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AutoScaleRun, o => new AutoScaleRun(o).Freeze()),
         nameof(AutoScaleRun),
         BindingAccess.Read);
     this.CertificateReferencesProperty = this.CreatePropertyAccessor(
         CertificateReference.ConvertFromProtocolCollection(protocolObject.CertificateReferences),
         nameof(CertificateReferences),
         BindingAccess.Read | BindingAccess.Write);
     this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.CloudServiceConfiguration, o => new CloudServiceConfiguration(o).Freeze()),
         nameof(CloudServiceConfiguration),
         BindingAccess.Read);
     this.CreationTimeProperty = this.CreatePropertyAccessor(
         protocolObject.CreationTime,
         nameof(CreationTime),
         BindingAccess.Read);
     this.CurrentDedicatedComputeNodesProperty = this.CreatePropertyAccessor(
         protocolObject.CurrentDedicatedNodes,
         nameof(CurrentDedicatedComputeNodes),
         BindingAccess.Read);
     this.CurrentLowPriorityComputeNodesProperty = this.CreatePropertyAccessor(
         protocolObject.CurrentLowPriorityNodes,
         nameof(CurrentLowPriorityComputeNodes),
         BindingAccess.Read);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         nameof(DisplayName),
         BindingAccess.Read);
     this.ETagProperty = this.CreatePropertyAccessor(
         protocolObject.ETag,
         nameof(ETag),
         BindingAccess.Read);
     this.IdProperty = this.CreatePropertyAccessor(
         protocolObject.Id,
         nameof(Id),
         BindingAccess.Read);
     this.IdentityProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Identity, o => new BatchPoolIdentity(o)),
         nameof(Identity),
         BindingAccess.Read | BindingAccess.Write);
     this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableInterNodeCommunication,
         nameof(InterComputeNodeCommunicationEnabled),
         BindingAccess.Read);
     this.LastModifiedProperty = this.CreatePropertyAccessor(
         protocolObject.LastModified,
         nameof(LastModified),
         BindingAccess.Read);
     this.MetadataProperty = this.CreatePropertyAccessor(
         MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata),
         nameof(Metadata),
         BindingAccess.Read | BindingAccess.Write);
     this.MountConfigurationProperty = this.CreatePropertyAccessor(
         Batch.MountConfiguration.ConvertFromProtocolCollectionAndFreeze(protocolObject.MountConfiguration),
         nameof(MountConfiguration),
         BindingAccess.Read);
     this.NetworkConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NetworkConfiguration, o => new NetworkConfiguration(o).Freeze()),
         nameof(NetworkConfiguration),
         BindingAccess.Read);
     this.ResizeErrorsProperty = this.CreatePropertyAccessor(
         ResizeError.ConvertFromProtocolCollectionReadOnly(protocolObject.ResizeErrors),
         nameof(ResizeErrors),
         BindingAccess.Read);
     this.ResizeTimeoutProperty = this.CreatePropertyAccessor(
         protocolObject.ResizeTimeout,
         nameof(ResizeTimeout),
         BindingAccess.Read);
     this.StartTaskProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.StartTask, o => new StartTask(o)),
         nameof(StartTask),
         BindingAccess.Read | BindingAccess.Write);
     this.StateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.PoolState, Common.PoolState>(protocolObject.State),
         nameof(State),
         BindingAccess.Read);
     this.StateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.StateTransitionTime,
         nameof(StateTransitionTime),
         BindingAccess.Read);
     this.StatisticsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Stats, o => new PoolStatistics(o).Freeze()),
         nameof(Statistics),
         BindingAccess.Read);
     this.TargetDedicatedComputeNodesProperty = this.CreatePropertyAccessor(
         protocolObject.TargetDedicatedNodes,
         nameof(TargetDedicatedComputeNodes),
         BindingAccess.Read);
     this.TargetLowPriorityComputeNodesProperty = this.CreatePropertyAccessor(
         protocolObject.TargetLowPriorityNodes,
         nameof(TargetLowPriorityComputeNodes),
         BindingAccess.Read);
     this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.TaskSchedulingPolicy, o => new TaskSchedulingPolicy(o).Freeze()),
         nameof(TaskSchedulingPolicy),
         BindingAccess.Read);
     this.TaskSlotsPerNodeProperty = this.CreatePropertyAccessor(
         protocolObject.TaskSlotsPerNode,
         nameof(TaskSlotsPerNode),
         BindingAccess.Read);
     this.UrlProperty = this.CreatePropertyAccessor(
         protocolObject.Url,
         nameof(Url),
         BindingAccess.Read);
     this.UserAccountsProperty = this.CreatePropertyAccessor(
         UserAccount.ConvertFromProtocolCollectionAndFreeze(protocolObject.UserAccounts),
         nameof(UserAccounts),
         BindingAccess.Read);
     this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineConfiguration, o => new VirtualMachineConfiguration(o).Freeze()),
         nameof(VirtualMachineConfiguration),
         BindingAccess.Read);
     this.VirtualMachineSizeProperty = this.CreatePropertyAccessor(
         protocolObject.VmSize,
         nameof(VirtualMachineSize),
         BindingAccess.Read);
 }
 public PropertyContainer(Models.CloudTask protocolObject) : base(BindingState.Bound)
 {
     this.AffinityInformationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AffinityInfo, o => new AffinityInformation(o).Freeze()),
         nameof(AffinityInformation),
         BindingAccess.Read);
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollectionAndFreeze(protocolObject.ApplicationPackageReferences),
         nameof(ApplicationPackageReferences),
         BindingAccess.Read);
     this.AuthenticationTokenSettingsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AuthenticationTokenSettings, o => new AuthenticationTokenSettings(o).Freeze()),
         nameof(AuthenticationTokenSettings),
         BindingAccess.Read);
     this.CommandLineProperty = this.CreatePropertyAccessor(
         protocolObject.CommandLine,
         nameof(CommandLine),
         BindingAccess.Read);
     this.ComputeNodeInformationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NodeInfo, o => new ComputeNodeInformation(o).Freeze()),
         nameof(ComputeNodeInformation),
         BindingAccess.Read);
     this.ConstraintsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Constraints, o => new TaskConstraints(o)),
         nameof(Constraints),
         BindingAccess.Read | BindingAccess.Write);
     this.ContainerSettingsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ContainerSettings, o => new TaskContainerSettings(o).Freeze()),
         nameof(ContainerSettings),
         BindingAccess.Read);
     this.CreationTimeProperty = this.CreatePropertyAccessor(
         protocolObject.CreationTime,
         nameof(CreationTime),
         BindingAccess.Read);
     this.DependsOnProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.DependsOn, o => new TaskDependencies(o).Freeze()),
         nameof(DependsOn),
         BindingAccess.Read);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         nameof(DisplayName),
         BindingAccess.Read);
     this.EnvironmentSettingsProperty = this.CreatePropertyAccessor(
         EnvironmentSetting.ConvertFromProtocolCollectionAndFreeze(protocolObject.EnvironmentSettings),
         nameof(EnvironmentSettings),
         BindingAccess.Read);
     this.ETagProperty = this.CreatePropertyAccessor(
         protocolObject.ETag,
         nameof(ETag),
         BindingAccess.Read);
     this.ExecutionInformationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExecutionInfo, o => new TaskExecutionInformation(o).Freeze()),
         nameof(ExecutionInformation),
         BindingAccess.Read);
     this.ExitConditionsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExitConditions, o => new ExitConditions(o).Freeze()),
         nameof(ExitConditions),
         BindingAccess.Read);
     this.FilesToStageProperty = this.CreatePropertyAccessor <IList <IFileStagingProvider> >(
         nameof(FilesToStage),
         BindingAccess.None);
     this.IdProperty = this.CreatePropertyAccessor(
         protocolObject.Id,
         nameof(Id),
         BindingAccess.Read);
     this.LastModifiedProperty = this.CreatePropertyAccessor(
         protocolObject.LastModified,
         nameof(LastModified),
         BindingAccess.Read);
     this.MultiInstanceSettingsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.MultiInstanceSettings, o => new MultiInstanceSettings(o).Freeze()),
         nameof(MultiInstanceSettings),
         BindingAccess.Read);
     this.OutputFilesProperty = this.CreatePropertyAccessor(
         OutputFile.ConvertFromProtocolCollectionAndFreeze(protocolObject.OutputFiles),
         nameof(OutputFiles),
         BindingAccess.Read);
     this.PreviousStateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.TaskState, Common.TaskState>(protocolObject.PreviousState),
         nameof(PreviousState),
         BindingAccess.Read);
     this.PreviousStateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.PreviousStateTransitionTime,
         nameof(PreviousStateTransitionTime),
         BindingAccess.Read);
     this.ResourceFilesProperty = this.CreatePropertyAccessor(
         ResourceFile.ConvertFromProtocolCollectionAndFreeze(protocolObject.ResourceFiles),
         nameof(ResourceFiles),
         BindingAccess.Read);
     this.StateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.TaskState, Common.TaskState>(protocolObject.State),
         nameof(State),
         BindingAccess.Read);
     this.StateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.StateTransitionTime,
         nameof(StateTransitionTime),
         BindingAccess.Read);
     this.StatisticsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Stats, o => new TaskStatistics(o).Freeze()),
         nameof(Statistics),
         BindingAccess.Read);
     this.UrlProperty = this.CreatePropertyAccessor(
         protocolObject.Url,
         nameof(Url),
         BindingAccess.Read);
     this.UserIdentityProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.UserIdentity, o => new UserIdentity(o).Freeze()),
         nameof(UserIdentity),
         BindingAccess.Read);
 }
Example #12
0
 public PropertyContainer(Models.PoolSpecification protocolObject) : base(BindingState.Bound)
 {
     this.ApplicationLicensesProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ApplicationLicenses, o => o),
         nameof(ApplicationLicenses),
         BindingAccess.Read | BindingAccess.Write);
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReferences),
         nameof(ApplicationPackageReferences),
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableAutoScale,
         nameof(AutoScaleEnabled),
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleEvaluationInterval,
         nameof(AutoScaleEvaluationInterval),
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleFormulaProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleFormula,
         nameof(AutoScaleFormula),
         BindingAccess.Read | BindingAccess.Write);
     this.CertificateReferencesProperty = this.CreatePropertyAccessor(
         CertificateReference.ConvertFromProtocolCollection(protocolObject.CertificateReferences),
         nameof(CertificateReferences),
         BindingAccess.Read | BindingAccess.Write);
     this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.CloudServiceConfiguration, o => new CloudServiceConfiguration(o)),
         nameof(CloudServiceConfiguration),
         BindingAccess.Read | BindingAccess.Write);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         nameof(DisplayName),
         BindingAccess.Read | BindingAccess.Write);
     this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableInterNodeCommunication,
         nameof(InterComputeNodeCommunicationEnabled),
         BindingAccess.Read);
     this.MaxTasksPerComputeNodeProperty = this.CreatePropertyAccessor(
         protocolObject.MaxTasksPerNode,
         nameof(MaxTasksPerComputeNode),
         BindingAccess.Read | BindingAccess.Write);
     this.MetadataProperty = this.CreatePropertyAccessor(
         MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata),
         nameof(Metadata),
         BindingAccess.Read | BindingAccess.Write);
     this.NetworkConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NetworkConfiguration, o => new NetworkConfiguration(o).Freeze()),
         nameof(NetworkConfiguration),
         BindingAccess.Read);
     this.ResizeTimeoutProperty = this.CreatePropertyAccessor(
         protocolObject.ResizeTimeout,
         nameof(ResizeTimeout),
         BindingAccess.Read | BindingAccess.Write);
     this.StartTaskProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.StartTask, o => new StartTask(o)),
         nameof(StartTask),
         BindingAccess.Read | BindingAccess.Write);
     this.TargetDedicatedComputeNodesProperty = this.CreatePropertyAccessor(
         protocolObject.TargetDedicatedNodes,
         nameof(TargetDedicatedComputeNodes),
         BindingAccess.Read | BindingAccess.Write);
     this.TargetLowPriorityComputeNodesProperty = this.CreatePropertyAccessor(
         protocolObject.TargetLowPriorityNodes,
         nameof(TargetLowPriorityComputeNodes),
         BindingAccess.Read | BindingAccess.Write);
     this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.TaskSchedulingPolicy, o => new TaskSchedulingPolicy(o)),
         nameof(TaskSchedulingPolicy),
         BindingAccess.Read | BindingAccess.Write);
     this.UserAccountsProperty = this.CreatePropertyAccessor(
         UserAccount.ConvertFromProtocolCollection(protocolObject.UserAccounts),
         nameof(UserAccounts),
         BindingAccess.Read | BindingAccess.Write);
     this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineConfiguration, o => new VirtualMachineConfiguration(o)),
         nameof(VirtualMachineConfiguration),
         BindingAccess.Read | BindingAccess.Write);
     this.VirtualMachineSizeProperty = this.CreatePropertyAccessor(
         protocolObject.VmSize,
         nameof(VirtualMachineSize),
         BindingAccess.Read | BindingAccess.Write);
 }
 public PSApplicationPackageReference()
 {
     this.omObject = new Microsoft.Azure.Batch.ApplicationPackageReference();
 }
 public PSApplicationPackageReference()
 {
     this.omObject = new Microsoft.Azure.Batch.ApplicationPackageReference();
 }
Example #15
0
 public PropertyContainer(Models.CloudTask protocolObject) : base(BindingState.Bound)
 {
     this.AffinityInformationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AffinityInfo, o => new AffinityInformation(o).Freeze()),
         "AffinityInformation",
         BindingAccess.Read);
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollectionAndFreeze(protocolObject.ApplicationPackageReferences),
         "ApplicationPackageReferences",
         BindingAccess.Read);
     this.CommandLineProperty = this.CreatePropertyAccessor(
         protocolObject.CommandLine,
         "CommandLine",
         BindingAccess.Read);
     this.ComputeNodeInformationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NodeInfo, o => new ComputeNodeInformation(o).Freeze()),
         "ComputeNodeInformation",
         BindingAccess.Read);
     this.ConstraintsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Constraints, o => new TaskConstraints(o)),
         "Constraints",
         BindingAccess.Read | BindingAccess.Write);
     this.CreationTimeProperty = this.CreatePropertyAccessor(
         protocolObject.CreationTime,
         "CreationTime",
         BindingAccess.Read);
     this.DependsOnProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.DependsOn, o => new TaskDependencies(o).Freeze()),
         "DependsOn",
         BindingAccess.Read);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         "DisplayName",
         BindingAccess.Read);
     this.EnvironmentSettingsProperty = this.CreatePropertyAccessor(
         EnvironmentSetting.ConvertFromProtocolCollectionAndFreeze(protocolObject.EnvironmentSettings),
         "EnvironmentSettings",
         BindingAccess.Read);
     this.ETagProperty = this.CreatePropertyAccessor(
         protocolObject.ETag,
         "ETag",
         BindingAccess.Read);
     this.ExecutionInformationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExecutionInfo, o => new TaskExecutionInformation(o).Freeze()),
         "ExecutionInformation",
         BindingAccess.Read);
     this.ExitConditionsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExitConditions, o => new ExitConditions(o).Freeze()),
         "ExitConditions",
         BindingAccess.Read);
     this.FilesToStageProperty = this.CreatePropertyAccessor <IList <IFileStagingProvider> >(
         "FilesToStage",
         BindingAccess.None);
     this.IdProperty = this.CreatePropertyAccessor(
         protocolObject.Id,
         "Id",
         BindingAccess.Read);
     this.LastModifiedProperty = this.CreatePropertyAccessor(
         protocolObject.LastModified,
         "LastModified",
         BindingAccess.Read);
     this.MultiInstanceSettingsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.MultiInstanceSettings, o => new MultiInstanceSettings(o).Freeze()),
         "MultiInstanceSettings",
         BindingAccess.Read);
     this.PreviousStateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.TaskState, Common.TaskState>(protocolObject.PreviousState),
         "PreviousState",
         BindingAccess.Read);
     this.PreviousStateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.PreviousStateTransitionTime,
         "PreviousStateTransitionTime",
         BindingAccess.Read);
     this.ResourceFilesProperty = this.CreatePropertyAccessor(
         ResourceFile.ConvertFromProtocolCollectionAndFreeze(protocolObject.ResourceFiles),
         "ResourceFiles",
         BindingAccess.Read);
     this.RunElevatedProperty = this.CreatePropertyAccessor(
         protocolObject.RunElevated,
         "RunElevated",
         BindingAccess.Read);
     this.StateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.TaskState, Common.TaskState>(protocolObject.State),
         "State",
         BindingAccess.Read);
     this.StateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.StateTransitionTime,
         "StateTransitionTime",
         BindingAccess.Read);
     this.StatisticsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Stats, o => new TaskStatistics(o).Freeze()),
         "Statistics",
         BindingAccess.Read);
     this.UrlProperty = this.CreatePropertyAccessor(
         protocolObject.Url,
         "Url",
         BindingAccess.Read);
 }
Example #16
0
 public PropertyContainer(Models.PoolSpecification protocolObject) : base(BindingState.Bound)
 {
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReferences),
         "ApplicationPackageReferences",
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableAutoScale,
         "AutoScaleEnabled",
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleEvaluationInterval,
         "AutoScaleEvaluationInterval",
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleFormulaProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleFormula,
         "AutoScaleFormula",
         BindingAccess.Read | BindingAccess.Write);
     this.CertificateReferencesProperty = this.CreatePropertyAccessor(
         CertificateReference.ConvertFromProtocolCollection(protocolObject.CertificateReferences),
         "CertificateReferences",
         BindingAccess.Read | BindingAccess.Write);
     this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.CloudServiceConfiguration, o => new CloudServiceConfiguration(o)),
         "CloudServiceConfiguration",
         BindingAccess.Read | BindingAccess.Write);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         "DisplayName",
         BindingAccess.Read | BindingAccess.Write);
     this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableInterNodeCommunication,
         "InterComputeNodeCommunicationEnabled",
         BindingAccess.Read);
     this.MaxTasksPerComputeNodeProperty = this.CreatePropertyAccessor(
         protocolObject.MaxTasksPerNode,
         "MaxTasksPerComputeNode",
         BindingAccess.Read | BindingAccess.Write);
     this.MetadataProperty = this.CreatePropertyAccessor(
         MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata),
         "Metadata",
         BindingAccess.Read | BindingAccess.Write);
     this.NetworkConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NetworkConfiguration, o => new NetworkConfiguration(o).Freeze()),
         "NetworkConfiguration",
         BindingAccess.Read);
     this.ResizeTimeoutProperty = this.CreatePropertyAccessor(
         protocolObject.ResizeTimeout,
         "ResizeTimeout",
         BindingAccess.Read | BindingAccess.Write);
     this.StartTaskProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.StartTask, o => new StartTask(o)),
         "StartTask",
         BindingAccess.Read | BindingAccess.Write);
     this.TargetDedicatedProperty = this.CreatePropertyAccessor(
         protocolObject.TargetDedicated,
         "TargetDedicated",
         BindingAccess.Read | BindingAccess.Write);
     this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.TaskSchedulingPolicy, o => new TaskSchedulingPolicy(o)),
         "TaskSchedulingPolicy",
         BindingAccess.Read | BindingAccess.Write);
     this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineConfiguration, o => new VirtualMachineConfiguration(o)),
         "VirtualMachineConfiguration",
         BindingAccess.Read | BindingAccess.Write);
     this.VirtualMachineSizeProperty = this.CreatePropertyAccessor(
         protocolObject.VmSize,
         "VirtualMachineSize",
         BindingAccess.Read | BindingAccess.Write);
 }
Example #17
0
 public PropertyContainer(Models.CloudPool protocolObject) : base(BindingState.Bound)
 {
     this.AllocationStateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.AllocationState, Common.AllocationState>(protocolObject.AllocationState),
         "AllocationState",
         BindingAccess.Read);
     this.AllocationStateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.AllocationStateTransitionTime,
         "AllocationStateTransitionTime",
         BindingAccess.Read);
     this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
         ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReferences),
         "ApplicationPackageReferences",
         BindingAccess.Read | BindingAccess.Write);
     this.AutoScaleEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableAutoScale,
         "AutoScaleEnabled",
         BindingAccess.Read);
     this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleEvaluationInterval,
         "AutoScaleEvaluationInterval",
         BindingAccess.Read);
     this.AutoScaleFormulaProperty = this.CreatePropertyAccessor(
         protocolObject.AutoScaleFormula,
         "AutoScaleFormula",
         BindingAccess.Read);
     this.AutoScaleRunProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AutoScaleRun, o => new AutoScaleRun(o).Freeze()),
         "AutoScaleRun",
         BindingAccess.Read);
     this.CertificateReferencesProperty = this.CreatePropertyAccessor(
         CertificateReference.ConvertFromProtocolCollection(protocolObject.CertificateReferences),
         "CertificateReferences",
         BindingAccess.Read | BindingAccess.Write);
     this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.CloudServiceConfiguration, o => new CloudServiceConfiguration(o).Freeze()),
         "CloudServiceConfiguration",
         BindingAccess.Read);
     this.CreationTimeProperty = this.CreatePropertyAccessor(
         protocolObject.CreationTime,
         "CreationTime",
         BindingAccess.Read);
     this.CurrentDedicatedProperty = this.CreatePropertyAccessor(
         protocolObject.CurrentDedicated,
         "CurrentDedicated",
         BindingAccess.Read);
     this.DisplayNameProperty = this.CreatePropertyAccessor(
         protocolObject.DisplayName,
         "DisplayName",
         BindingAccess.Read);
     this.ETagProperty = this.CreatePropertyAccessor(
         protocolObject.ETag,
         "ETag",
         BindingAccess.Read);
     this.IdProperty = this.CreatePropertyAccessor(
         protocolObject.Id,
         "Id",
         BindingAccess.Read);
     this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor(
         protocolObject.EnableInterNodeCommunication,
         "InterComputeNodeCommunicationEnabled",
         BindingAccess.Read);
     this.LastModifiedProperty = this.CreatePropertyAccessor(
         protocolObject.LastModified,
         "LastModified",
         BindingAccess.Read);
     this.MaxTasksPerComputeNodeProperty = this.CreatePropertyAccessor(
         protocolObject.MaxTasksPerNode,
         "MaxTasksPerComputeNode",
         BindingAccess.Read);
     this.MetadataProperty = this.CreatePropertyAccessor(
         MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata),
         "Metadata",
         BindingAccess.Read | BindingAccess.Write);
     this.NetworkConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NetworkConfiguration, o => new NetworkConfiguration(o).Freeze()),
         "NetworkConfiguration",
         BindingAccess.Read);
     this.ResizeErrorProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ResizeError, o => new ResizeError(o).Freeze()),
         "ResizeError",
         BindingAccess.Read);
     this.ResizeTimeoutProperty = this.CreatePropertyAccessor(
         protocolObject.ResizeTimeout,
         "ResizeTimeout",
         BindingAccess.Read);
     this.StartTaskProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.StartTask, o => new StartTask(o)),
         "StartTask",
         BindingAccess.Read | BindingAccess.Write);
     this.StateProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.MapNullableEnum <Models.PoolState, Common.PoolState>(protocolObject.State),
         "State",
         BindingAccess.Read);
     this.StateTransitionTimeProperty = this.CreatePropertyAccessor(
         protocolObject.StateTransitionTime,
         "StateTransitionTime",
         BindingAccess.Read);
     this.StatisticsProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Stats, o => new PoolStatistics(o).Freeze()),
         "Statistics",
         BindingAccess.Read);
     this.TargetDedicatedProperty = this.CreatePropertyAccessor(
         protocolObject.TargetDedicated,
         "TargetDedicated",
         BindingAccess.Read);
     this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.TaskSchedulingPolicy, o => new TaskSchedulingPolicy(o).Freeze()),
         "TaskSchedulingPolicy",
         BindingAccess.Read);
     this.UrlProperty = this.CreatePropertyAccessor(
         protocolObject.Url,
         "Url",
         BindingAccess.Read);
     this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor(
         UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineConfiguration, o => new VirtualMachineConfiguration(o).Freeze()),
         "VirtualMachineConfiguration",
         BindingAccess.Read);
     this.VirtualMachineSizeProperty = this.CreatePropertyAccessor(
         protocolObject.VmSize,
         "VirtualMachineSize",
         BindingAccess.Read);
 }