Smartsheet.Api.Internal.ImageUrlsResourcesImpl.GetImageUrls C# (CSharp) Method

GetImageUrls() public method

Gets URLs that can be used to retrieve the specified cell images.

It mirrors To the following Smartsheet REST API method: POST /imageurls

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public GetImageUrls ( IEnumerable requestUrls ) : ImageUrlMap
requestUrls IEnumerable array of requested Images and sizes
return Smartsheet.Api.Models.ImageUrlMap
        public virtual ImageUrlMap GetImageUrls(IEnumerable<ImageUrl> requestUrls)
        {
            string path = "imageurls/";

            Utility.Utility.ThrowIfNull(requestUrls);

            HttpRequest request = null;
            try
            {
                request = CreateHttpRequest(new Uri(this.Smartsheet.BaseURI, path), HttpMethod.POST);
            }
            catch (Exception e)
            {
                throw new SmartsheetException(e);
            }

            request.Entity = serializeToEntity<IEnumerable<ImageUrl>>(requestUrls);

            HttpResponse response = this.Smartsheet.HttpClient.Request(request);

            ImageUrlMap obj = null;
            switch (response.StatusCode)
            {
                case HttpStatusCode.OK:
                    obj = this.Smartsheet.JsonSerializer.deserialize<ImageUrlMap>(response.Entity.GetContent());
                    break;
                default:
                    HandleError(response);
                    break;
            }

            Smartsheet.HttpClient.ReleaseConnection();

            return obj;
        }