Skip to content

Instantly share code, notes, and snippets.

View herasimau's full-sized avatar

Leanid Herasimau herasimau

View GitHub Profile
package it.miapizza.alexa.service;
import it.miapizza.alexa.models.Order;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Query;
public interface OrderService {
package it.miapizza.alexa.service;
import it.miapizza.alexa.models.AddToCart;
import it.miapizza.alexa.models.Cart;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;
public interface CartService {
package it.miapizza.alexa.service;
import it.miapizza.alexa.models.Auth;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;
public interface AuthService {
@herasimau
herasimau / order-creation.java
Created December 23, 2019 13:30
OrderCreation
public static OrderConfirmation order(Pizza pizza) throws IOException{
Auth auth = RunnerPizzaAuthUtils.getAuth();
Map<String, String> cartParams = buildCartParams();
CartService cartService = ServiceGenerator.createService(CartService.class, auth.getAccessToken() , true);
verifyCart(cartService, cartParams);
addToCart(cartService, cartParams, pizza);
return buildOrderConfirmation(auth, cartParams, pizza);
}
@herasimau
herasimau / hande_order.java
Last active December 23, 2019 13:26
Handle order
@Override
public Optional<Response> handle(HandlerInput handlerInput, IntentRequest intentRequest) {
String pizzaName = intentRequest.getIntent().getSlots().get(SlotData.PIZZA).getValue();
return SkillUtils.orderPizzaResponse(handlerInput, pizzaName, MessagesData.BUNDLE_NAME, MessagesData.ORDER_SPEECH);
}
@herasimau
herasimau / new-order.java
Created December 23, 2019 13:04
NewOrder
public class NewOrderIntentHandler implements IntentRequestHandler {
@Override
public boolean canHandle(HandlerInput handlerInput, IntentRequest intentRequest) {
return intentRequest.getIntent().getName().equals(IntentData.NEW_ORDER);
}
@Override
public Optional<Response> handle(HandlerInput handlerInput, IntentRequest intentRequest) {
return SkillUtils.pizzaListResponse(handlerInput, MessagesData.BUNDLE_NAME, MessagesData.PIZZA_LIST_SPEECH);
@herasimau
herasimau / packer.json
Created June 15, 2018 11:20
Packer config
{
"variables": {
"image_name": "",
"version": "",
"cfg_file": "",
"winrm_password": ""
},
"builders": [
{
"name": "windows-oci",
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEYgLwNpNUaVzyhkkC88RiaFo1IxTpNGafVlwpUnav0Q8AhZyzGXeT5rOyQF2bGhtJCoE6pQtcoYGMTC0hCWrLEjnEQ1UaEwsMIC0dNazhYN2hJPvoe8N5g2hj7XOcX7hQnbwm3FiuenQKaEODPcZ/MsaNpQTXRVnCrVlovjXQotK+9BKIolu5/kXXs7Pxe84AN/rDw6xvQ6hCeBOAX0x0/99JYQaiCFm6163cUJ8SvYd5IATIURmHbPvMK/MIl1oZH8yaqlMgy0HzRQFTXWcknwcsiDtr55yrAttDNCA3S+d4yuXok0K1InKbBVqAfz7Ha5Nf4Q/7GVZ5J8J27rxB herasimau@herasimau-Latitude-E6540
2018/02/19 11:02:17 Preparing build: centos-6-opc
2018/02/19 11:02:17 Waiting on builds to complete...
2018/02/19 11:02:17 Starting build run: centos-6-opc
2018/02/19 11:02:17 Running builder: oracle-classic
2018/02/19 11:02:17 [INFO] (telemetry) Starting builder oracle-classic
2018/02/19 11:02:18 ui: ==> centos-6-opc: Creating temporary ssh key for instance...
2018/02/19 11:02:18 ui: centos-6-opc: Creating temporary IP reservation: ipres__5a8aa0aa-573d-96ac-7e77-ec5759d5bd24
2018/02/19 11:02:20 ui: ==> centos-6-opc: Creating temporary key: /Compute-domain/devops@domain/packer_generated_key_5a8aa0ac-4bc8-1b81-6eaa-cc3d6ee803f4
2018/02/19 11:02:24 ui: ==> centos-6-opc: Configuring security lists and rules to enable SSH access...
2018/02/19 11:02:26 ui: ==> centos-6-opc: Creating Instance...