Exemplo n.º 1
0
        /// <summary>
        /// Set document property.
        /// </summary>
        /// <param name="request">Request. <see cref="PutSlidesSetDocumentPropertyRequest" /></param>
        /// <returns><see cref="DocumentPropertyResponse"/></returns>
        public DocumentPropertyResponse PutSlidesSetDocumentProperty(PutSlidesSetDocumentPropertyRequest request)
        {
            // verify the required parameter 'name' is set
            if (request.Name == null)
            {
                throw new ApiException(400, "Missing required parameter 'name' when calling PutSlidesSetDocumentProperty");
            }

            // verify the required parameter 'propertyName' is set
            if (request.PropertyName == null)
            {
                throw new ApiException(400, "Missing required parameter 'propertyName' when calling PutSlidesSetDocumentProperty");
            }

            // create path and map variables
            string resourcePath = GetResourceUrl("/slides/{name}/documentproperties/{propertyName}");

            resourcePath = UrlHelper.AddPathParameter(resourcePath, "name", request.Name);
            resourcePath = UrlHelper.AddPathParameter(resourcePath, "propertyName", request.PropertyName);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.Folder);
            resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.Storage);
            string contentType;
            var    postBody = SerializationHelper.Serialize(request.Property, out contentType); // http body (model) parameter
            var    files    = new List <FileInfo>();

            PickFiles(files, request);
            return(InvokeApi <DocumentPropertyResponse>(resourcePath, "PUT", postBody, null, files, contentType));
        }
Exemplo n.º 2
0
        private PutSlidesSetDocumentPropertyRequest createPutSlidesSetDocumentPropertyRequest()
        {
            PutSlidesSetDocumentPropertyRequest request = new PutSlidesSetDocumentPropertyRequest();

            request.Name         = "test.pptx";
            request.PropertyName = "author";
            DocumentProperty prop = new DocumentProperty();

            prop.Name        = "author";
            request.Property = prop;

            return(request);
        }
Exemplo n.º 3
0
        public void putSlidesSetDocumentPropertyTest()
        {
            DocumentPropertyResponse response = null;

            try
            {
                PutSlidesSetDocumentPropertyRequest request = createPutSlidesSetDocumentPropertyRequest();
                response = api.PutSlidesSetDocumentProperty(request);
                Console.WriteLine(response.Code);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public void PutSlidesSetDocumentPropertyInvalidStorage()
        {
            InvalidPropertyTestExecutor <PutSlidesSetDocumentPropertyRequest, DocumentPropertyResponse> testExecutor =
                new InvalidPropertyTestExecutor <PutSlidesSetDocumentPropertyRequest, DocumentPropertyResponse>("PutSlidesSetDocumentProperty", "Storage");
            PutSlidesSetDocumentPropertyRequest request  = testExecutor.PrepareRequest();
            DocumentPropertyResponse            response = null;
            bool needAssertResponse = false;

            try
            {
                response           = m_instance.PutSlidesSetDocumentProperty(request);
                needAssertResponse = true;
            }
            catch (Exception ex)
            {
                testExecutor.AssertException(ex);
            }
            if (needAssertResponse)
            {
                testExecutor.AssertResult(response);
            }
        }