Ejemplo n.º 1
0
        public ModelEnvironment UpdateEnvironment(string environmentId, UpdateEnvironmentRequest body)
        {
            if (string.IsNullOrEmpty(environmentId))
            {
                throw new ArgumentNullException(nameof(environmentId));
            }
            if (body == null)
            {
                throw new ArgumentNullException(nameof(body));
            }

            if (string.IsNullOrEmpty(VersionDate))
            {
                throw new ArgumentNullException("versionDate cannot be null. Use 'DISCOVERY_VERSION_DATE_2016_12_01'");
            }

            ModelEnvironment result = null;

            try
            {
                result = this.Client.WithAuthentication(this.UserName, this.Password)
                         .PutAsync($"{this.Endpoint}/v1/environments/{environmentId}")
                         .WithArgument("version", VersionDate)
                         .WithBody <UpdateEnvironmentRequest>(body)
                         .As <ModelEnvironment>()
                         .Result;
            }
            catch (AggregateException ae)
            {
                throw ae.Flatten();
            }

            return(result);
        }
Ejemplo n.º 2
0
    private IEnumerator ExampleCreateEnvironment()
    {
        ModelEnvironment createEnvironmentResponse = null;

        service.CreateEnvironment(
            callback: (DetailedResponse <ModelEnvironment> response, IBMError error) =>
        {
            Log.Debug("DiscoveryServiceV1", "CreateEnvironment result: {0}", response.Response);
            createEnvironmentResponse = response.Result;
            // environmentId = createEnvironmentResponse.EnvironmentId;
        },
            name: "my_environment",
            description: "My environment"
            );

        while (createEnvironmentResponse == null)
        {
            yield return(null);
        }
    }
Ejemplo n.º 3
0
 public void DeleteFromViewAndModel(ModelEnvironment me)
 {
     vc.Delete();
     me.RemoveComponent(mc);
 }
Ejemplo n.º 4
0
 public void DeleteFromViewAndModel(ModelEnvironment me)
 {
     vb.Delete();
     mb.Delete();
     me.RemoveBlock(this.mb);
 }
Ejemplo n.º 5
0
 public void DeleteFromViewAndModel(ModelEnvironment me)
 {
     this.vl.Delete();
     me.RemoveLink(ml);
 }