public static CreateSlotResponse Unmarshall(UnmarshallerContext _ctx) { CreateSlotResponse createSlotResponse = new CreateSlotResponse(); createSlotResponse.HttpResponse = _ctx.HttpResponse; createSlotResponse.Code = _ctx.StringValue("CreateSlot.Code"); createSlotResponse.Success = _ctx.BooleanValue("CreateSlot.Success"); createSlotResponse.Message = _ctx.StringValue("CreateSlot.Message"); createSlotResponse.RequestId = _ctx.StringValue("CreateSlot.RequestId"); CreateSlotResponse.CreateSlot_Model model = new CreateSlotResponse.CreateSlot_Model(); model.CreateTime = _ctx.LongValue("CreateSlot.Model.CreateTime"); model.ModifyTime = _ctx.LongValue("CreateSlot.Model.ModifyTime"); model.TenantId = _ctx.StringValue("CreateSlot.Model.TenantId"); model.MediaName = _ctx.StringValue("CreateSlot.Model.MediaName"); model.MediaId = _ctx.StringValue("CreateSlot.Model.MediaId"); model.AdSlotId = _ctx.StringValue("CreateSlot.Model.AdSlotId"); model.AdSlotName = _ctx.StringValue("CreateSlot.Model.AdSlotName"); model.AdSlotType = _ctx.StringValue("CreateSlot.Model.AdSlotType"); model.AdSlotTemplateId = _ctx.StringValue("CreateSlot.Model.AdSlotTemplateId"); model.AdSlotStatus = _ctx.StringValue("CreateSlot.Model.AdSlotStatus"); model.AdSlotCorporateStatus = _ctx.StringValue("CreateSlot.Model.AdSlotCorporateStatus"); model.ExtInfo = _ctx.StringValue("CreateSlot.Model.ExtInfo"); model.BlockingRule = _ctx.StringValue("CreateSlot.Model.BlockingRule"); model.InspireScene = _ctx.StringValue("CreateSlot.Model.InspireScene"); model.Version = _ctx.LongValue("CreateSlot.Model.Version"); createSlotResponse.Model = model; return(createSlotResponse); }
public async Task <ActionResult <CreateSlotResponse> > Post([FromForm] CreateSlotRequest request, CancellationToken cancellationToken) { var slot = new Slot( request.Title, request.Description, request.CategoryId, request.OwnerId, null, request.StartPrice ); await _slotService.AddPicturesToSlot(slot, request.Pictures, cancellationToken); slot = await _slotRepository.AddAsync(slot, cancellationToken); var response = new CreateSlotResponse(request.CorrelationId()); response.SlotId = slot.Id; return(response); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateSlotResponse response = new CreateSlotResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("botId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BotId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("botVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.BotVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("creationDateTime", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationDateTime = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("intentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IntentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("localeId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.LocaleId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("multipleValuesSetting", targetDepth)) { var unmarshaller = MultipleValuesSettingUnmarshaller.Instance; response.MultipleValuesSetting = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("obfuscationSetting", targetDepth)) { var unmarshaller = ObfuscationSettingUnmarshaller.Instance; response.ObfuscationSetting = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("slotId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SlotId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("slotName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SlotName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("slotTypeId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.SlotTypeId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("valueElicitationSetting", targetDepth)) { var unmarshaller = SlotValueElicitationSettingUnmarshaller.Instance; response.ValueElicitationSetting = unmarshaller.Unmarshall(context); continue; } } return(response); }