Example #1
0
        /// <summary>
        /// Update the specified organization with data from <see cref="OrganizationUpdate"/>.
        /// </summary>
        /// <param name="organizationName">The name of the organization to update.</param>
        /// <param name="updateRequest"></param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        /// <returns>A <see cref="Organization"/></returns>
        public IObservable <Organization> Update(string organizationName, OrganizationUpdate updateRequest)
        {
            Ensure.ArgumentNotNullOrEmptyString(organizationName, nameof(organizationName));
            Ensure.ArgumentNotNull(updateRequest, nameof(updateRequest));

            return(_client.Update(organizationName, updateRequest).ToObservable());
        }
Example #2
0
            public void RequestsTheCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableOrganizationsClient(gitHubClient);

                var organizationUpdate = new OrganizationUpdate();

                client.Update("initrode", organizationUpdate);

                gitHubClient.Received().Organization.Update("initrode", organizationUpdate);
            }
 public IActionResult Update([FromBody, SwaggerRequestBody("Form to update an organization", Required = true)] OrganizationUpdate form)
 {
     try
     {
         OrganizationGet organization = _service.Update(form.ToServiceLayer()).ToApi();
         return(Ok(organization));
     }
     catch (ArgumentNullException e)
     {
         return(new BadRequestObjectResult(e.Message));
     }
 }
            public void PutsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new OrganizationsClient(connection);

                var editOrganization = new OrganizationUpdate {
                    Name = "name"
                };

                client.Edit(123, editOrganization);

                connection.Received().Put <Organization>(Arg.Is <Uri>(u => u.ToString() == "organizations/123"),
                                                         Arg.Is <OrganizationUpdate>(d => d.Name == "name"));
            }
 /// <summary>
 /// Update the specified organization with data from <see cref="OrganizationUpdate"/>.
 /// </summary>
 /// <param name="organizationName">The name of the organization to update.</param>
 /// <param name="updateRequest"></param>
 /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
 /// <returns>A <see cref="Organization"/></returns>
 public IObservable <Organization> Update(string organizationName, OrganizationUpdate updateRequest)
 {
     return(_client.Update(organizationName, updateRequest).ToObservable());
 }
 /// <summary>
 /// Update the specified organization with data from <see cref="OrganizationUpdate"/>.
 /// </summary>
 /// <param name="organizationName">The name of the organization to update.</param>
 /// <param name="updateRequest"></param>
 /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
 /// <returns>A <see cref="Organization"/></returns>
 public IObservable<Organization> Update(string organizationName, OrganizationUpdate updateRequest)
 {
     return _client.Update(organizationName, updateRequest).ToObservable();
 }
Example #7
0
 public VOrganisation Update(OrganizationUpdate body)
 {
     return(_repository.Update(body.ToDal()).ToServiceLayer());
 }
            public void RequestsTheCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableOrganizationsClient(gitHubClient);

                var organizationUpdate = new OrganizationUpdate();
                client.Update("initrode", organizationUpdate);

                gitHubClient.Received().Organization.Update("initrode", organizationUpdate);
            }
        /// <summary>
        /// Update the specified organization with data from <see cref="OrganizationUpdate"/>.
        /// </summary>
        /// <param name="organizationName">The name of the organization to update.</param>
        /// <param name="updateRequest"></param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        /// <returns>A <see cref="Organization"/></returns>
        public IObservable<Organization> Update(string organizationName, OrganizationUpdate updateRequest)
        {
            Ensure.ArgumentNotNullOrEmptyString(organizationName, "organizationName");
            Ensure.ArgumentNotNull(updateRequest, "updateRequest");

            return _client.Update(organizationName, updateRequest).ToObservable();
        }