private static GoogleCardMessage BuildGoogleCardFrom(CreateJobContext createJobContext, string description)
        {
            var mapImage = GoogleMapsHelper.GetStaticMapLinkFor(createJobContext.Property.MapAddress);
            var mapLink  = GoogleMapsHelper.GetGoogleMapsLinkFor(createJobContext.Property.MapAddress);

            return(GoogleCardBuilder.Create()
                   .Title($"New Job for {createJobContext.Client.Name}")
                   .Content(description)
                   .Image(mapImage, "Map of job location.")
                   .WithButton("Open Map", mapLink)
                   .Build());
        }
Exemplo n.º 2
0
        private static FulfillmentResponse BuildClientFoundResponse(Client client)
        {
            var context = new CreateJobContext
            {
                Client   = client,
                Property = client.MyProperties.First()
            };

            return(FulfillmentResponseBuilder.Create()
                   .Speech($"Okay! What are you going to do for {client.Name}?")
                   .WithContext(
                       ContextBuilder.For(Constants.Contexts.CreateJobClientSet)
                       .WithParameter(Constants.Variables.CreateJobContext, context)
                       )
                   .Build());
        }