/// <summary> 
		/// Update an existing Entitylist for a specific tenant.
		/// <example> 
		///  <code> 
		/// var result = EntityListFactory.UpdateEntityList(handler : handler,  entityList :  entityList,  entityListFullName :  entityListFullName,  responseFields :  responseFields,  expectedCode: expectedCode, successCode: successCode); 
		/// var optionalCasting = ConvertClass<EntityList/>(result); 
		/// return optionalCasting;
		///  </code> 
		/// </example> 
		/// </summary>
		public static Mozu.Api.Contracts.MZDB.EntityList UpdateEntityList(ServiceClientMessageHandler handler, 
 		 Mozu.Api.Contracts.MZDB.EntityList entityList, string entityListFullName, 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.EntityListClient.UpdateEntityListClient(
				 entityList :  entityList,  entityListFullName :  entityListFullName,  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;

		}
Beispiel #2
0
        public virtual Mozu.Api.Contracts.MZDB.EntityList UpdateEntityList(Mozu.Api.Contracts.MZDB.EntityList entityList, string entityListFullName, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.MZDB.EntityList> response;
            var client = Mozu.Api.Clients.Platform.EntityListClient.UpdateEntityListClient(entityList, entityListFullName, responseFields);

            client.WithContext(_apiContext);
            response = client.Execute();
            return(response.Result());
        }
Beispiel #3
0
        /// <summary>
        /// Update an existing Entitylist for a specific tenant.
        /// </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="entityList">The definition of an MZDB EntityList which describes the characteristics of the EntityList on a per tenant basis. EntityLists are created at the tenant level, but instances of the EntityLists are implicitly created at the appropriate context level as entities are added or removed from the EntityList.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.MZDB.EntityList"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var entitylist = new EntityList();
        ///   var entityList = await entitylist.UpdateEntityListAsync( entityList,  entityListFullName,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.MZDB.EntityList> UpdateEntityListAsync(Mozu.Api.Contracts.MZDB.EntityList entityList, string entityListFullName, string responseFields = null)
        {
            MozuClient <Mozu.Api.Contracts.MZDB.EntityList> response;
            var client = Mozu.Api.Clients.Platform.EntityListClient.UpdateEntityListClient(entityList, entityListFullName, responseFields);

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

            return(await response.ResultAsync());
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <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="entityList">The definition of an MZDB EntityList which describes the characteristics of the EntityList on a per tenant basis. EntityLists are created at the tenant level, but instances of the EntityLists are implicitly created at the appropriate context level as entities are added or removed from the EntityList.</param>
        /// <returns>
        ///  <see cref="Mozu.Api.MozuClient" />{<see cref="Mozu.Api.Contracts.MZDB.EntityList"/>}
        /// </returns>
        /// <example>
        /// <code>
        ///   var mozuClient=CreateEntityList( entityList,  responseFields);
        ///   var entityListClient = mozuClient.WithBaseAddress(url).Execute().Result();
        /// </code>
        /// </example>
        public static MozuClient <Mozu.Api.Contracts.MZDB.EntityList> CreateEntityListClient(Mozu.Api.Contracts.MZDB.EntityList entityList, string responseFields = null)
        {
            var          url        = Mozu.Api.Urls.Platform.EntityListUrl.CreateEntityListUrl(responseFields);
            const string verb       = "POST";
            var          mozuClient = new MozuClient <Mozu.Api.Contracts.MZDB.EntityList>()
                                      .WithVerb(verb).WithResourceUrl(url)
                                      .WithBody <Mozu.Api.Contracts.MZDB.EntityList>(entityList);

            return(mozuClient);
        }
        /// <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="entityList">The definition of an MZDB EntityList which describes the characteristics of the EntityList on a per tenant basis. EntityLists are created at the tenant level, but instances of the EntityLists are implicitly created at the appropriate context level as entities are added or removed from the EntityList.</param>
        /// <returns>
        /// <see cref="Mozu.Api.Contracts.MZDB.EntityList"/>
        /// </returns>
        /// <example>
        /// <code>
        ///   var entitylist = new EntityList();
        ///   var entityList = await entitylist.UpdateEntityListAsync( entityList,  entityListFullName,  responseFields);
        /// </code>
        /// </example>
        public virtual async Task <Mozu.Api.Contracts.MZDB.EntityList> UpdateEntityListAsync(Mozu.Api.Contracts.MZDB.EntityList entityList, string entityListFullName, string responseFields = null, CancellationToken ct = default(CancellationToken))
        {
            MozuClient <Mozu.Api.Contracts.MZDB.EntityList> response;
            var client = Mozu.Api.Clients.Platform.EntityListClient.UpdateEntityListClient(entityList, entityListFullName, responseFields);

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

            return(await response.ResultAsync());
        }