/// <summary>
        /// Updates an existing entity list view. Each view provides display context levels (site, tenant, catalog, master catalog) and settings for the list of entities.
        /// <example>
        ///  <code>
        /// var result = ListViewFactory.UpdateEntityListView(handler : handler,  listView :  listView,  entityListFullName :  entityListFullName,  viewName :  viewName,  responseFields :  responseFields,  expectedCode: expectedCode, successCode: successCode);
        /// var optionalCasting = ConvertClass<ListView/>(result);
        /// return optionalCasting;
        ///  </code>
        /// </example>
        /// </summary>
        public static Mozu.Api.Contracts.MZDB.ListView UpdateEntityListView(ServiceClientMessageHandler handler,
                                                                            Mozu.Api.Contracts.MZDB.ListView listView, string entityListFullName, string viewName, string responseFields = null,
                                                                            HttpStatusCode expectedCode = HttpStatusCode.OK, HttpStatusCode successCode = HttpStatusCode.OK)
        {
            SetSdKparameters();
            var currentClassName  = System.Reflection.MethodInfo.GetCurrentMethod().DeclaringType.Name;
            var currentMethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;

            Debug.WriteLine(currentMethodName + '.' + currentMethodName);
            var apiClient = Mozu.Api.Clients.Platform.Entitylists.ListViewClient.UpdateEntityListViewClient(
                listView:  listView, entityListFullName:  entityListFullName, viewName:  viewName, responseFields:  responseFields);

            try
            {
                apiClient.WithContext(handler.ApiContext).Execute();
            }
            catch (ApiException ex)
            {
                // Custom error handling for test cases can be placed here
                Exception customException = TestFailException.GetCustomTestException(ex, currentClassName, currentMethodName, expectedCode);
                if (customException != null)
                {
                    throw customException;
                }
                return(null);
            }
            return(ResponseMessageFactory.CheckResponseCodes(apiClient.HttpResponse.StatusCode, expectedCode, successCode)
                                         ? (apiClient.Result())
                                         : null);
        }
        public virtual Mozu.Api.Contracts.MZDB.ListView UpdateEntityListView(Mozu.Api.Contracts.MZDB.ListView listView, string entityListFullName, string viewName, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.MZDB.ListView> response;
            var client = Mozu.Api.Clients.Platform.Entitylists.ListViewClient.UpdateEntityListViewClient(listView, entityListFullName, viewName, responseFields);

            client.WithContext(_apiContext);
            response = client.Execute();
            return(response.Result());
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="entityListFullName">The full name of the EntityList including namespace in name@nameSpace format</param>
        /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param>
        /// <param name="viewName">The name for a view. Views are used to render data in , such as document and entity lists. Each view includes a schema, format, name, ID, and associated data types to render.</param>
        /// <param name="listView">Properties for the list view that specifies what fields and content display per page load. All associated fields in the list view correspond with object data.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.MZDB.ListView"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=UpdateEntityListView( listView,  entityListFullName,  viewName,  responseFields);
        ///   var listViewClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.MZDB.ListView> UpdateEntityListViewClient(Mozu.Api.Contracts.MZDB.ListView listView, string entityListFullName, string viewName, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Platform.Entitylists.ListViewUrl.UpdateEntityListViewUrl(entityListFullName, viewName, responseFields);
            const string verb       = "PUT";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.MZDB.ListView>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.MZDB.ListView>(listView);

            return(mozuClient);
        }
        /// <summary>
        /// Creates an entity list view. Each view provides display context levels (site, tenant, catalog, master catalog) and settings for the list of entities.
        /// </summary>
        /// <param name="entityListFullName">The full name of the EntityList including namespace in name@nameSpace format</param>
        /// <param name="responseFields">Use this field to include those fields which are not included by default.</param>
        /// <param name="listView">Properties for the list view that specifies what fields and content display per page load. All associated fields in the list view correspond with object data.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.MZDB.ListView"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var listview = new ListView();
        ///   var listView = await listview.CreateEntityListViewAsync( listView,  entityListFullName,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.MZDB.ListView> CreateEntityListViewAsync(Mozu.Api.Contracts.MZDB.ListView listView, string entityListFullName, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.MZDB.ListView> response;
            var client = Mozu.Api.Clients.Platform.Entitylists.ListViewClient.CreateEntityListViewClient(listView, entityListFullName, responseFields);

            client.WithContext(_apiContext);
            response = await client.ExecuteAsync();

            return(await response.ResultAsync());
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="entityListFullName">The full name of the EntityList including namespace in name@nameSpace format</param>
        /// <param name="responseFields">Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.</param>
        /// <param name="viewName">The name for a view. Views are used to render data in , such as document and entity lists. Each view includes a schema, format, name, ID, and associated data types to render.</param>
        /// <param name="listView">Properties for the list view that specifies what fields and content display per page load. All associated fields in the list view correspond with object data.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.MZDB.ListView"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var listview = new ListView();
        ///   var listView = await listview.UpdateEntityListViewAsync( listView,  entityListFullName,  viewName,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.MZDB.ListView> UpdateEntityListViewAsync(Mozu.Api.Contracts.MZDB.ListView listView, string entityListFullName, string viewName, string responseFields = null, CancellationToken ct = default(CancellationToken))
        {
            MozuClient <Mozu.Api.Contracts.MZDB.ListView> response;
            var client = Mozu.Api.Clients.Platform.Entitylists.ListViewClient.UpdateEntityListViewClient(listView, entityListFullName, viewName, responseFields);

            client.WithContext(_apiContext);
            response = await client.ExecuteAsync(ct).ConfigureAwait(false);

            return(await response.ResultAsync());
        }