text:
// include statements
#include <climits>
#include <iostream>
#include <cstddef>
#include <cstdlib>
#include <ctime>
#include <limits>
#include <cmath>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/algorithms/intersects.hpp>
#include "matplotlibcpp.h"

//Obstcale Points- Change points here to edit obstacles
int obst_array[][2] = {{2, 7}, {7, 7}, {6, 4}, {4, 4}, {4, 6}, {2, 6}};

//typedefs to define geometries in boost geometry
typedef boost::geometry::model::d2::point_xy<double> point_xy;
typedef boost::geometry::model::polygon<point_xy> polygon_type;
typedef boost::geometry::model::multi_polygon<polygon_type> multi_polygon_type;
typedef boost::geometry::model::linestring<point_xy> linestring_t;

//variable to keep track of goal sampling and goal sampling rate
int g_sampling;
int a;

// Node tructure definiton
struct Node
{
    // x and y define the 2D coordinates of the node
    float x;
    float y;
    // Parent Node to the current Node
    Node *parent;
};

//array of all nodes
Node node_list[500];

// counter to keep track of no. of elements in node_list
int count = 0;

//array to store the path in
Node path[100];

//variable to track elements in path
int track = 0;

//sampler variables- used to set the sampling range
//Change these to use a different search space
int Offset = 0;
int Range = 13;

//Search space is defined from (0,0), (0,12), (12,0) and (12,12)
// function to sample random points in search space and also sample the goal at regular intervals defined by g_sampling
Node sampler(int goal_x, int goal_y)
{
    /*
        Args:
            goal_x(int): x-coordinate of the goal
            goal_y(int): y-coordinate of the goal

        Retuns:
            sample(Node object): The sampled node
    */
    Node sample = {};
    //samples random points
    if (count < a)
    {
        sample.x = Offset + (rand() % Range);
        sample.y = Offset + (rand() % Range);
        sample.parent = NULL;
    }
    //samples goal as every g_sampling th point
    else
    {
        a += g_sampling;
        sample.x = goal_x;
        sample.y = goal_y;
        sample.parent = NULL;
    }

    return sample;
}

//finds distance between two Node's
float distance(Node node1, Node node2)
{
    /*
        Args:
            node1(Node object): first node for distance calculation
            node2(Node object): second node for distance calculation

        Retuns:
            dist(float): the distance between the nodes
    */
    float dist = sqrt(((node1.x - node2.x) * (node1.x - node2.x)) + ((node1.y - node2.y) * (node1.y - node2.y)));
    return dist;
}

//function to find the nearest node to the passed node
int nearest_node(Node current)
{
    /*
        Args:
            current(Node object):node for which nearest node is to be found

        Retuns:
            near_i(int): the index of the nearest node wrt node_list
    */
    int near_i;
    float min_dist = 20;
    for (int i = 0; i < count; i++)
    {
        float dist = distance(current, node_list[i]);
        if (dist < min_dist)
        {
            min_dist = dist;
            near_i = i;
        }
    }

    return near_i;
}

//checks intersection between obstacles and the line segment (rand,near) using boost-geometry
bool check_intersection(Node end1, Node end2)
{
    /*
        Args:
            end1(Node object): first node of the line segment
            end2(Node object): second node of the line segment

        Retuns:
            status(bool): 1 if it collides with obstacles, 0 otherwise
    */

    //define polygons and multi-polygons
    polygon_type obstacle;
    multi_polygon_type obstacles;
    linestring_t line;

    //Adding the line
    // Store points in vector so we can assign them to a polygon
    std::vector<point_xy> pointList;

    point_xy point1(end1.x, end1.y);
    pointList.push_back(point1);

    point_xy point2(end2.x, end2.y);
    pointList.push_back(point2);

    // assign points to polygon line
    boost::geometry::assign_points(line, pointList);

    //Adding the obstacle
    // Store points in vector so we can assign them to a polygon
    std::vector<point_xy> ObstaclePointList;

    for (int i = 0; i < (sizeof(obst_array) / sizeof(obst_array[0])); i++)
    {
        point_xy point(obst_array[i][0], obst_array[i][1]);
        ObstaclePointList.push_back(point);
    }

    // assign points to polygon
    boost::geometry::assign_points(obstacle, ObstaclePointList);

    // Add polygon to multi-polygon
    obstacles.push_back(obstacle);

    //checks if line intersects with obstacles
    bool status = boost::geometry::intersects(line, obstacles);

    return status;
}

//checks if a point is inside an obstacle using boost-geometry
bool is_inside_obstacle(float a, float b)
{
    /*
        Args:
            a(float): x-coordinate of the point to be checked
            b(float): y-coordinate of the point to be checked

        Retuns:
            status(bool): 1 if it is within obstacles, 0 otherwise
    */
    //define polygons and multi-polygons
    polygon_type obstacle;
    multi_polygon_type obstacles;

    //Adding the point
    point_xy point(a, b);

    //Adding the obstacle
    // Store points in vector so we can assign them to a polygon
    std::vector<point_xy> ObstaclePointList;

    for (int i = 0; i < (sizeof(obst_array) / sizeof(obst_array[0])); i++)
    {
        point_xy point(obst_array[i][0], obst_array[i][1]);
        ObstaclePointList.push_back(point);
    }

    // assign points to polygon
    boost::geometry::assign_points(obstacle, ObstaclePointList);

    // Add polygon to multi-polygon
    obstacles.push_back(obstacle);

    //checks if point is within obstacles
    bool status = boost::geometry::within(point, obstacles);

    return status;
}

//function to backtrack path from goal to start
void backtrack(Node goal, Node start)
{
    /*
        Args:
            goal(Node object): goal
            start(Node object): start
    */
    //initialize current node as the goal
    Node *current = &goal;
    while (current->parent != NULL)
    {
        path[track] = *current;
        track++;
        //assign current node as its parent
        current = current->parent;
    }

    //Add start to the path
    path[track] = start;
    track++;
}

//function to visualise path using matplotlib-cpp
void visualise(bool is_path)
{
    /*
        Args:
            is_path(bool): status of whether path exists or not
    */
    namespace plt = matplotlibcpp;
    //plot obstacle
    std::vector<double> x = {};
    std::vector<double> y = {};

    for (int i = 0; i < (sizeof(obst_array) / sizeof(obst_array[0])); i++)
    {
        x.push_back(obst_array[i][0]);
        y.push_back(obst_array[i][1]);
    }
    x.push_back(obst_array[0][0]);
    y.push_back(obst_array[0][1]);

    plt::plot(x, y);

    //scatter plot if all nodes
    std::vector<double> scatter_x = {};
    std::vector<double> scatter_y = {};

    for (int i = 0; i < count; i++)
    {

        scatter_x.push_back(node_list[i].x);
        scatter_y.push_back(node_list[i].y);
    }

    plt::plot(scatter_x, scatter_y, ".r");

    //plot tree
    for (int i = 0; i < count; i++)
    {
        if (node_list[i].parent != NULL)
        {
            std::vector<double> node_x = {};
            std::vector<double> node_y = {};
            node_x.push_back(node_list[i].x);
            node_y.push_back(node_list[i].y);
            node_x.push_back(node_list[i].parent->x);
            node_y.push_back(node_list[i].parent->y);
            plt::plot(node_x, node_y, "r");
        }
    }

    if (is_path == 1)
    {
        //plot path
        for (int i = 0; i < track; i++)
        {
            if (path[i].parent != NULL)
            {
                std::vector<double> node_x = {};
                std::vector<double> node_y = {};
                node_x.push_back(path[i].x);
                node_y.push_back(path[i].y);
                node_x.push_back(path[i].parent->x);
                node_y.push_back(path[i].parent->y);
                plt::plot(node_x, node_y, ".b-");
            }
        }
    }

    plt::show();
}

// Start of main RRT function
//returns 0 if path not found and 1 if path is found
bool rrt(float start_x, float start_y, float goal_x, float goal_y, int K, float step)
{
    /*
        Args:
            start_x(float):x-coordinate of the start point
            start_y(float):y-coordinate of the start point
            goal_x(float):x-coordinate of the goal point
            goal_y(float):y-coordinate of the goal point
            K(int):maximum number of nodes in the tree
            step(float):step-size for RRT

        Returns:
            1, if path is found
            0, otherwise
    */
    //variable to track if goal has been reached
    bool not_reached;

    // defining start, goal and rand as a Node
    Node start = {start_x, start_y};
    Node goal = {goal_x, goal_y};
    Node rand = {};

    //variable to store index of the nearest neighbour
    int near_i;

    //add start to the node_list
    node_list[count] = start;
    count++;

    for (int j = 0; j < K;)
    {
        //samples a random point
        rand = sampler(goal_x, goal_y);

        // finds the index of the nearest node to the sampled point
        near_i = nearest_node(rand);

        //computing the angle b/w near and rand wrt x-axis
        float theta = atan2(rand.y - node_list[near_i].y, rand.x - node_list[near_i].x);

        //uses step-size to modify rand to a point in its direction, at a step distance from near
        rand.x = node_list[near_i].x + step * cos(theta);
        rand.y = node_list[near_i].y + step * sin(theta);

        //obstacle checking
        bool status = check_intersection(rand, node_list[near_i]);
        if (status == 1)
        {
            //if the line intersects any obstacle
            continue;
        }
        else
        {
            //adds line to node_list if it is collision free
            rand.parent = &node_list[near_i];
            node_list[count] = rand;
            count++;
            j++;
        }

        //variable to track if a direct connection to the goal is possible
        not_reached = check_intersection(rand, goal);

        //variable to store distance between current node and goal
        float goal_dist = distance(rand, goal);

        //adds goal to the node_list and breaks if goal is reachable or justa step-size distance away
        if (not_reached == 0 || goal_dist <= step)
        {
            goal.parent = &rand;
            node_list[count] = goal;
            count++;
            //Goal Reached
            break;
        }
    }
    //returns 0 if path not found
    if (not_reached == 1)
    {
        return 0;
    }

    //calls function to traverse from goal to start using their parent fields
    backtrack(goal, start);

    //returns 1 as path is founs succesfully
    return 1;
}

int main()
{
    // Providing a seed value for rand in sampler function
    srand((unsigned)time(NULL));

    //variables of rrt
    float start_x, start_y, goal_x, goal_y, K, step;

    //Print search space and obstacle end points
    std::cout << "\033[2J\033[1;1H";
    std::cout << "Rapidly Exploring Random Trees" << std::endl;
    std::cout << "The Search space is defined by points (0,0), (0,12), (12,0) and (12,12)" << std::endl;
    std::cout << "The Obstacle is a polygon defined by points (2, 7), (7, 7), (6, 4), (4, 4), (4, 6) and (2, 6)" << std::endl;

    //Taking user input for the rrt variables
    while (1)
    {
        std::cout << "Enter the x-coordinate of start(0-12):";
        std::cin >> start_x;

        std::cout << "Enter the y-coordinate of start(0-12):";
        std::cin >> start_y;

        if (start_x < 0 || start_x > 12 || start_y < 0 || start_y > 12)
        {
            std::cout << "The point is outside the Search space! Retry" << std::endl;
        }
        else if (is_inside_obstacle(start_x, start_y))
        {
            std::cout << "Point inside obstacle! Retry" << std::endl;
        }
        else
        {
            break;
        }
    }

    std::cout << "\033[2J\033[1;1H";
    std::cout << "Rapidly Exploring Random Trees" << std::endl;
    std::cout << "The Search space is defined by points (0,0), (0,12), (12,0) and (12,12)" << std::endl;
    std::cout << "The Obstacle is a polygon defined by points (2, 7), (7, 7), (6, 4), (4, 4), (4, 6) and (2, 6)" << std::endl;

    while (1)
    {
        std::cout << "Enter the x-coordinate of goal(0-12):";
        std::cin >> goal_x;

        std::cout << "Enter the y-coordinate of goal(0-12):";
        std::cin >> goal_y;

        if (goal_x < 0 || goal_x > 12 || goal_y < 0 || goal_y > 12)
        {
            std::cout << "The point is outside the Search space! Retry" << std::endl;
        }
        else if (is_inside_obstacle(goal_x, goal_y))
        {
            std::cout << "Point inside obstacle! Retry" << std::endl;
        }
        else
        {
            break;
        }
    }

    std::cout << "\033[2J\033[1;1H";
    std::cout << "Rapidly Exploring Random Trees" << std::endl;
    std::cout << "The Search space is defined by points (0,0), (0,12), (12,0) and (12,12)" << std::endl;
    std::cout << "The Obstacle is a polygon defined by points (2, 7), (7, 7), (6, 4), (4, 4), (4, 6) and (2, 6)" << std::endl;

    std::cout << "Enter the maximum number of nodes in the tree(0-499):";
    std::cin >> K;

    std::cout << "Enter the step-size for RRT(Preferably between 0.1-2):";
    std::cin >> step;

    std::cout << "Enter the rate at which the goal should be sampled(Enter 0 to generate an unbiased tree)" << std::endl
              << "(Enter 25 if you want every 25th sample to be the goal):";
    std::cin >> g_sampling;

    if (g_sampling == 0)
    {
        g_sampling = K + 1;
    }

    //variable assignment to ensure goal sampling rate is followed
    a = g_sampling;

    std::cout << "\033[2J\033[1;1H";
    std::cout << "Rapidly Exploring Random Trees" << std::endl;
    std::cout << "Finding a path!! Please Wait!" << std::endl;

    //call rrt function- start point is assumed to be the origin
    bool is_path = rrt(start_x, start_y, goal_x, goal_y, K, step);

    //plots the path and the tree
    visualise(is_path);

    if(is_path==0)
    {
        std::cout<<"Sorry,Path Not Found!!";
    }

    //print nodelist
    // for(int i=0;i<count;i++)
    // {
    //     std::cout<<node_list[i].x<<" "<<node_list[i].y<<std::endl;
    // }

    //print path
    // for(int i=0;i<track;i++)
    //     {
    //         std::cout<<path[i].x<<" "<<path[i].y<<std::endl;
    //     }

    return 0;
}


text:
/**
 * MIT License
 *
 * Copyright (c) 2017 Thibaut Goetghebuer-Planchon <tessil@gmx.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#define BOOST_TEST_DYN_LINK

#include <tsl/array_set.h>

#include <boost/mpl/list.hpp>
#include <boost/test/unit_test.hpp>
#include <tuple>

#include "utils.h"

BOOST_AUTO_TEST_SUITE(test_array_set)

using test_types = boost::mpl::list<
    tsl::array_set<char>, tsl::array_set<wchar_t>, tsl::array_set<char16_t>,
    tsl::array_set<char32_t>,
    tsl::array_set<char, tsl::ah::str_hash<char>, tsl::ah::str_equal<char>,
                   false>,
    tsl::array_set<wchar_t, tsl::ah::str_hash<wchar_t>,
                   tsl::ah::str_equal<wchar_t>, false>,
    tsl::array_set<char16_t, tsl::ah::str_hash<char16_t>,
                   tsl::ah::str_equal<char16_t>, false>,
    tsl::array_set<char32_t, tsl::ah::str_hash<char32_t>,
                   tsl::ah::str_equal<char32_t>, false>,
    tsl::array_pg_set<char16_t>,
    tsl::array_set<char16_t, tsl::ah::str_hash<char16_t>,
                   tsl::ah::str_equal<char16_t>, false, std::uint16_t,
                   std::uint16_t, tsl::ah::mod_growth_policy<>>>;

/**
 * insert
 */
BOOST_AUTO_TEST_CASE_TEMPLATE(test_insert, ASet, test_types) {
  // insert x values, insert them again, check values
  using char_tt = typename ASet::char_type;

  const size_t nb_values = 1000;
  ASet set;
  typename ASet::iterator it;
  bool inserted;

  for (size_t i = 0; i < nb_values; i++) {
    const auto key = utils::get_key<char_tt>(i);
    std::tie(it, inserted) = set.insert(key);

    BOOST_CHECK(set.key_eq()(it.key(), it.key_size(), key.c_str(), key.size()));
    BOOST_CHECK(inserted);
  }
  BOOST_CHECK_EQUAL(set.size(), nb_values);

  for (size_t i = 0; i < nb_values; i++) {
    const auto key = utils::get_key<char_tt>(i);
    std::tie(it, inserted) = set.insert(key);

    BOOST_CHECK(set.key_eq()(it.key(), it.key_size(), key.c_str(), key.size()));
    BOOST_CHECK(!inserted);
  }

  for (size_t i = 0; i < nb_values; i++) {
    const auto key = utils::get_key<char_tt>(i);
    it = set.find(key);

    BOOST_CHECK(it != set.end());
    BOOST_CHECK(set.key_eq()(it.key(), it.key_size(), key.c_str(), key.size()));
  }
}

BOOST_AUTO_TEST_CASE(test_insert_more_than_max_size) {
  tsl::array_set<char, tsl::ah::str_hash<char>, tsl::ah::str_equal<char>, true,
                 std::uint16_t, std::uint8_t>
      set;
  for (std::size_t i = 0; i < set.max_size(); i++) {
    set.insert(utils::get_key<char>(i));
  }

  BOOST_CHECK_EQUAL(set.size(), set.max_size());
  BOOST_CHECK_THROW(set.insert(utils::get_key<char>(set.max_size())),
                    std::length_error);
}

BOOST_AUTO_TEST_CASE(test_insert_with_too_long_string) {
  tsl::array_set<char, tsl::ah::str_hash<char>, tsl::ah::str_equal<char>, true,
                 std::uint8_t, std::uint16_t>
      set;
  for (std::size_t i = 0; i < 10; i++) {
    set.insert(utils::get_key<char>(i));
  }

  const std::string long_string(set.max_key_size(), 'a');
  BOOST_CHECK(set.insert(long_string).second);

  const std::string too_long_string(set.max_key_size() + 1, 'a');
  BOOST_CHECK_THROW(set.insert(too_long_string), std::length_error);
}

/**
 * operator== and operator!=
 */
BOOST_AUTO_TEST_CASE(test_compare) {
  const tsl::array_set<char> set1 = {"aa", "ee", "dd", "cc", "bb"};
  const tsl::array_set<char> set1_copy = {"ee", "cc", "bb", "aa", "dd"};
  const tsl::array_set<char> set2 = {"ee", "cc", "bb", "aa", "dd", "ff"};
  const tsl::array_set<char> set3 = {"ee", "cc", "bb", "aa"};
  const tsl::array_set<char> set4 = {"aa", "ee", "dd", "cc", "zz"};

  BOOST_CHECK(set1 == set1_copy);
  BOOST_CHECK(set1_copy == set1);

  BOOST_CHECK(set1 != set2);
  BOOST_CHECK(set2 != set1);

  BOOST_CHECK(set1 != set3);
  BOOST_CHECK(set3 != set1);

  BOOST_CHECK(set1 != set4);
  BOOST_CHECK(set4 != set1);

  BOOST_CHECK(set2 != set3);
  BOOST_CHECK(set3 != set2);

  BOOST_CHECK(set2 != set4);
  BOOST_CHECK(set4 != set2);

  BOOST_CHECK(set3 != set4);
  BOOST_CHECK(set4 != set3);
}

/**
 * serialize and deserialize
 */
BOOST_AUTO_TEST_CASE(test_serialize_deserialize) {
  // insert x values; delete some values; serialize set; deserialize in new set;
  // check equal. for deserialization, test it with and without hash
  // compatibility.
  const std::size_t nb_values = 1000;

  tsl::array_set<char32_t> set(0);

  set.insert(U"");
  for (std::size_t i = 1; i < nb_values + 40; i++) {
    set.insert(utils::get_key<char32_t>(i));
  }

  for (std::size_t i = nb_values; i < nb_values + 40; i++) {
    set.erase(utils::get_key<char32_t>(i));
  }
  BOOST_CHECK_EQUAL(set.size(), nb_values);

  serializer serial;
  set.serialize(serial);

  deserializer dserial(serial.str());
  auto set_deserialized = decltype(set)::deserialize(dserial, true);
  BOOST_CHECK(set_deserialized == set);

  deserializer dserial2(serial.str());
  set_deserialized = decltype(set)::deserialize(dserial2, false);
  BOOST_CHECK(set_deserialized == set);
}

BOOST_AUTO_TEST_SUITE_END()

ext: cpp

max_stars_repo_name: Tessil/array-hash

max_issues_repo_name: Tessil/array-hash

max_forks_repo_name: Tessil/array-hash


text:
#pragma once

#include <libyuv/scale.h>
#include <spdlog/common.h>

#include <cstddef>
#include <cstdint>
#include <string>

#include <boost/cstdint.hpp>
#include <boost/rational.hpp>

#include "constants.hpp"

namespace CLI {

class App;

}

namespace hisui {

namespace config {

enum struct AudioMixer {
  Simple,
  Vttoth,
};

enum OutVideoCodec {
  VP8 = hisui::Constants::VP8_FOURCC,
  VP9 = hisui::Constants::VP9_FOURCC,
};

enum struct VideoComposer {
  Grid,
  ParallelGrid,
};

enum struct VideoScaler {
  Simple,
  PreserveAspectRatio,
};

enum struct OutContainer {
  WebM,
  MP4,
};

enum struct MP4Muxer {
  Simple,
  Faststart,
};

enum struct OutAudioCodec {
  Opus,
  FDK_AAC,
};

}  // namespace config

class Config {
 public:
  bool enabledReport() const;
  bool enabledSuccessReport() const;
  bool enabledFailureReport() const;
  void validate() const;

  std::string in_metadata_filename;
  std::string screen_capture_metadata_filename = "";
  std::string screen_capture_connection_id = "";
  config::OutVideoCodec out_video_codec = config::OutVideoCodec::VP9;
  config::OutContainer out_container = config::OutContainer::WebM;
  std::uint32_t out_video_bit_rate = 0;

  boost::rational<std::uint64_t> out_video_frame_rate =
      boost::rational<std::uint64_t>(25, 1);
  std::uint32_t libvpx_cq_level = 30;
  std::uint32_t libvpx_min_q = 10;
  std::uint32_t libvpx_max_q = 50;
  std::uint32_t out_opus_bit_rate = Constants::OPUS_DEFAULT_BIT_RATE;
  std::uint32_t out_aac_bit_rate = Constants::FDK_AAC_DEFAULT_BIT_RATE;

  std::string out_filename = "";
  std::string directory_for_faststart_intermediate_file = "";

  std::size_t max_columns = 3;

  bool verbose = false;
  bool audio_only = false;
  std::string success_report = "";
  std::string failure_report = "";

  // 以降は SPEC.rst にないオプション
  bool show_progress_bar = true;

#ifdef NDEBUG
  spdlog::level::level_enum log_level = spdlog::level::info;
#else
  spdlog::level::level_enum log_level = spdlog::level::debug;
#endif
  std::uint32_t scaling_width = 320;
  std::uint32_t scaling_height = 240;

  std::uint32_t screen_capture_width = 960;
  std::uint32_t screen_capture_height = 640;
  std::uint32_t screen_capture_bit_rate = 1000;

  std::uint32_t libvpx_threads = 0;
  std::int32_t libvpx_cpu_used = 8;
  std::uint32_t libvp9_frame_parallel = 1;
  std::uint32_t libvp9_tile_columns = 0;
  std::uint32_t libvp9_row_mt = 0;

  libyuv::FilterMode libyuv_filter_mode = libyuv::kFilterBox;

  config::VideoComposer video_composer = config::VideoComposer::Grid;
  config::VideoScaler video_scaler = config::VideoScaler::PreserveAspectRatio;
  std::string openh264 = "";

  config::AudioMixer audio_mixer = config::AudioMixer::Simple;
  bool mix_screen_capture_audio = false;

  config::MP4Muxer mp4_muxer = config::MP4Muxer::Faststart;
  config::OutAudioCodec out_audio_codec = config::OutAudioCodec::Opus;
};

void set_cli_options(CLI::App* app, Config* config);

}  // namespace hisui

ext: hpp

max_stars_repo_name: shiguredo/hisui

max_issues_repo_name: shiguredo/hisui

max_forks_repo_name: shiguredo/hisui


text:
//
//  Copyright (c) 2011 Vladimir Chalupecky
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
//  IN THE SOFTWARE.

#define BOOST_TEST_MODULE Triangulation
#include <boost/test/unit_test.hpp>
#include <cmath>

#include "io/Postscript_ostream.h"
#include "Triangulation_items.h"
#include "Triangulation.h"

using namespace umeshu;

typedef Triangulation<Triangulation_items> Tria;
typedef Tria::Node_handle             Node_handle;
typedef Tria::Halfedge_handle         Halfedge_handle;
typedef Tria::Edge_handle             Edge_handle;
typedef Tria::Face_handle             Face_handle;

BOOST_AUTO_TEST_CASE(construction_and_access)
{
    Tria tria;
    Node_handle n1 = tria.add_node(Point2(0.0, 0.0));
    BOOST_CHECK(n1->position().x() == 0.0);
    BOOST_CHECK(n1->position().y() == 0.0);
    BOOST_CHECK(n1->is_isolated());
    BOOST_CHECK(tria.number_of_nodes() == 1);
    BOOST_CHECK(tria.number_of_edges() == 0);
    BOOST_CHECK(tria.number_of_faces() == 0);

    Node_handle n2 = tria.add_node(Point2(1.0, 0.0));
    BOOST_CHECK(n2->position().x() == 1.0);
    BOOST_CHECK(n2->position().y() == 0.0);
    BOOST_CHECK(n2->is_isolated());
    BOOST_CHECK(tria.number_of_nodes() == 2);
    BOOST_CHECK(tria.number_of_edges() == 0);
    BOOST_CHECK(tria.number_of_faces() == 0);

    Node_handle n3 = tria.add_node(Point2(0.0, 1.0));
    BOOST_CHECK(n3->position().x() == 0.0);
    BOOST_CHECK(n3->position().y() == 1.0);
    BOOST_CHECK(n3->is_isolated());
    BOOST_CHECK(tria.number_of_nodes() == 3);
    BOOST_CHECK(tria.number_of_edges() == 0);
    BOOST_CHECK(tria.number_of_faces() == 0);

    Halfedge_handle he1 = tria.add_edge(n1, n2);
    Halfedge_handle he1p = he1->pair();
    BOOST_CHECK(he1->origin() == n1);
    BOOST_CHECK(he1p->origin() == n2);
    BOOST_CHECK(he1->next() == he1p);
    BOOST_CHECK(he1->prev() == he1p);
    BOOST_CHECK(he1p->next() == he1);
    BOOST_CHECK(he1p->prev() == he1);
    BOOST_CHECK(tria.number_of_nodes() == 3);
    BOOST_CHECK(tria.number_of_halfedges() == 2);
    BOOST_CHECK(tria.number_of_edges() == 1);
    BOOST_CHECK(tria.number_of_faces() == 0);

    Halfedge_handle he2 = tria.add_edge(n2, n3);
    Halfedge_handle he3 = tria.add_edge(n3, n1);
    BOOST_CHECK(tria.number_of_nodes() == 3);
    BOOST_CHECK(tria.number_of_halfedges() == 6);
    BOOST_CHECK(tria.number_of_edges() == 3);
    BOOST_CHECK(tria.number_of_faces() == 0);

    Face_handle f = tria.add_face(he1, he2, he3);
    BOOST_CHECK(tria.number_of_nodes() == 3);
    BOOST_CHECK(tria.number_of_halfedges() == 6);
    BOOST_CHECK(tria.number_of_edges() == 3);
    BOOST_CHECK(tria.number_of_faces() == 1);

    tria.remove_face(f);
    BOOST_CHECK(tria.number_of_nodes() == 3);
    BOOST_CHECK(tria.number_of_halfedges() == 6);
    BOOST_CHECK(tria.number_of_edges() == 3);
    BOOST_CHECK(tria.number_of_faces() == 0);

    f = tria.add_face(he1, he2, he3);
    tria.remove_edge(he1->edge());
    BOOST_CHECK(tria.number_of_nodes() == 3);
    BOOST_CHECK(tria.number_of_halfedges() == 4);
    BOOST_CHECK(tria.number_of_edges() == 2);
    BOOST_CHECK(tria.number_of_faces() == 0);

    he1 = tria.add_edge(n1, n2);
    f = tria.add_face(he1, he2, he3);
    tria.remove_node(n1);
    BOOST_CHECK(tria.number_of_nodes() == 2);
    BOOST_CHECK(tria.number_of_halfedges() == 2);
    BOOST_CHECK(tria.number_of_edges() == 1);
    BOOST_CHECK(tria.number_of_faces() == 0);
}

BOOST_AUTO_TEST_CASE(insertion_in_edge)
{
    Tria tria;
    Node_handle n1 = tria.add_node(Point2(0.0, 0.0));
    Node_handle n2 = tria.add_node(Point2(1.0, 0.0));
    Node_handle n3 = tria.add_node(Point2(1.0, 1.0));
    Node_handle n4 = tria.add_node(Point2(0.0, 1.0));
    Halfedge_handle h1 = tria.add_edge(n1, n2);
    Halfedge_handle h2 = tria.add_edge(n2, n3);
    Halfedge_handle h3 = tria.add_edge(n3, n4);
    Halfedge_handle h4 = tria.add_edge(n4, n1);
    Halfedge_handle h5 = tria.add_edge(n3, n1);
    tria.add_face(h1, h2, h5);
    tria.add_face(h3, h4, h5->pair());
    BOOST_CHECK(tria.number_of_nodes() == 4);
    BOOST_CHECK(tria.number_of_halfedges() == 10);
    BOOST_CHECK(tria.number_of_edges() == 5);
    BOOST_CHECK(tria.number_of_faces() == 2);

    {
        io::Postscript_ostream ps("insert_in_edge_1.eps", tria.bounding_box());
        ps << tria;
    }
    tria.insert_in_edge(h5->edge(), Point2(0.5,0.5));
    BOOST_CHECK(tria.number_of_nodes() == 5);
    BOOST_CHECK(tria.number_of_halfedges() == 16);
    BOOST_CHECK(tria.number_of_edges() == 8);
    BOOST_CHECK(tria.number_of_faces() == 4);
    {
        io::Postscript_ostream ps("insert_in_edge_2.eps", tria.bounding_box());
        ps << tria;
    }
}


text:
/**
 * Cloud Manager API
 * This API allows access to Cloud Manager programs, pipelines, and environments by an authorized technical account created through the Adobe I/O Console. The base url for this API is https://cloudmanager.adobe.io, e.g. to get the list of programs for an organization, you would make a GET request to https://cloudmanager.adobe.io/api/programs (with the correct set of headers as described below). This swagger file can be downloaded from https://raw.githubusercontent.com/AdobeDocs/cloudmanager-api-docs/master/swagger-specs/api.yaml.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: opensource@shinesolutions.com
 *
 * NOTE: This class is auto generated by OpenAPI-Generator 4.3.1-SNAPSHOT.
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#include "PipelineExecutionApi.h"
#include "IHttpBody.h"
#include "JsonBody.h"
#include "MultipartFormData.h"

#include <unordered_set>

#include <boost/algorithm/string/replace.hpp>

namespace org {
namespace openapitools {
namespace client {
namespace api {

using namespace org::openapitools::client::model;

PipelineExecutionApi::PipelineExecutionApi( std::shared_ptr<const ApiClient> apiClient )
    : m_ApiClient(apiClient)
{
}

PipelineExecutionApi::~PipelineExecutionApi()
{
}

pplx::task<void> PipelineExecutionApi::advancePipelineExecution(utility::string_t programId, utility::string_t pipelineId, utility::string_t executionId, utility::string_t phaseId, utility::string_t stepId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey, utility::string_t contentType, std::shared_ptr<Object> body) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution/{executionId}/phase/{phaseId}/step/{stepId}/advance");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("executionId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(executionId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("phaseId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(phaseId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("stepId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(stepId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->advancePipelineExecution does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;
    localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Content-Type")] = ApiClient::parameterToString(contentType);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
        web::json::value localVarJson;

        localVarJson = ModelBase::toJson(body);

        localVarHttpBody = std::shared_ptr<IHttpBody>( new JsonBody( localVarJson ) );
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
        std::shared_ptr<MultipartFormData> localVarMultipart(new MultipartFormData);
        localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body));

        localVarHttpBody = localVarMultipart;
        localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary();
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->advancePipelineExecution does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling advancePipelineExecution: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling advancePipelineExecution: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        return void();
    });
}
pplx::task<void> PipelineExecutionApi::cancelPipelineExecutionStep(utility::string_t programId, utility::string_t pipelineId, utility::string_t executionId, utility::string_t phaseId, utility::string_t stepId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey, utility::string_t contentType, std::shared_ptr<Object> body) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution/{executionId}/phase/{phaseId}/step/{stepId}/cancel");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("executionId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(executionId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("phaseId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(phaseId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("stepId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(stepId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->cancelPipelineExecutionStep does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;
    localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Content-Type")] = ApiClient::parameterToString(contentType);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
        web::json::value localVarJson;

        localVarJson = ModelBase::toJson(body);

        localVarHttpBody = std::shared_ptr<IHttpBody>( new JsonBody( localVarJson ) );
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
        std::shared_ptr<MultipartFormData> localVarMultipart(new MultipartFormData);
        localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), body));

        localVarHttpBody = localVarMultipart;
        localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary();
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->cancelPipelineExecutionStep does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling cancelPipelineExecutionStep: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling cancelPipelineExecutionStep: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        return void();
    });
}
pplx::task<std::shared_ptr<PipelineExecution>> PipelineExecutionApi::getCurrentExecution(utility::string_t programId, utility::string_t pipelineId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
    localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->getCurrentExecution does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->getCurrentExecution does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling getCurrentExecution: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling getCurrentExecution: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        std::shared_ptr<PipelineExecution> localVarResult(new PipelineExecution());

        if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json"))
        {
            web::json::value localVarJson = web::json::value::parse(localVarResponse);

            ModelBase::fromJson(localVarJson, localVarResult);
        }
        // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data"))
        // {
        // TODO multipart response parsing
        // }
        else
        {
            throw ApiException(500
                , utility::conversions::to_string_t("error calling getCurrentExecution: unsupported response type"));
        }

        return localVarResult;
    });
}
pplx::task<std::shared_ptr<PipelineExecution>> PipelineExecutionApi::getExecution(utility::string_t programId, utility::string_t pipelineId, utility::string_t executionId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution/{executionId}");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("executionId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(executionId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
    localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->getExecution does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->getExecution does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling getExecution: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling getExecution: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        std::shared_ptr<PipelineExecution> localVarResult(new PipelineExecution());

        if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json"))
        {
            web::json::value localVarJson = web::json::value::parse(localVarResponse);

            ModelBase::fromJson(localVarJson, localVarResult);
        }
        // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data"))
        // {
        // TODO multipart response parsing
        // }
        else
        {
            throw ApiException(500
                , utility::conversions::to_string_t("error calling getExecution: unsupported response type"));
        }

        return localVarResult;
    });
}
pplx::task<std::shared_ptr<PipelineExecutionListRepresentation>> PipelineExecutionApi::getExecutions(utility::string_t programId, utility::string_t pipelineId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey, boost::optional<utility::string_t> start, boost::optional<int32_t> limit) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/executions");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
    localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->getExecutions does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }
    if (start)
    {
        localVarQueryParams[utility::conversions::to_string_t("start")] = ApiClient::parameterToString(*start);
    }
    if (limit)
    {
        localVarQueryParams[utility::conversions::to_string_t("limit")] = ApiClient::parameterToString(*limit);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->getExecutions does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling getExecutions: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling getExecutions: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        std::shared_ptr<PipelineExecutionListRepresentation> localVarResult(new PipelineExecutionListRepresentation());

        if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json"))
        {
            web::json::value localVarJson = web::json::value::parse(localVarResponse);

            ModelBase::fromJson(localVarJson, localVarResult);
        }
        // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data"))
        // {
        // TODO multipart response parsing
        // }
        else
        {
            throw ApiException(500
                , utility::conversions::to_string_t("error calling getExecutions: unsupported response type"));
        }

        return localVarResult;
    });
}
pplx::task<void> PipelineExecutionApi::getStepLogs(utility::string_t programId, utility::string_t pipelineId, utility::string_t executionId, utility::string_t phaseId, utility::string_t stepId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey, boost::optional<utility::string_t> file, boost::optional<utility::string_t> accept) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution/{executionId}/phase/{phaseId}/step/{stepId}/logs");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("executionId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(executionId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("phaseId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(phaseId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("stepId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(stepId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->getStepLogs does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }
    if (file)
    {
        localVarQueryParams[utility::conversions::to_string_t("file")] = ApiClient::parameterToString(*file);
    }
    if (accept)
    {
        localVarHeaderParams[utility::conversions::to_string_t("Accept")] = ApiClient::parameterToString(*accept);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->getStepLogs does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling getStepLogs: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling getStepLogs: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        return void();
    });
}
pplx::task<void> PipelineExecutionApi::startPipeline(utility::string_t programId, utility::string_t pipelineId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey, utility::string_t contentType) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->startPipeline does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Content-Type")] = ApiClient::parameterToString(contentType);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->startPipeline does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling startPipeline: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling startPipeline: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        return void();
    });
}
pplx::task<std::shared_ptr<PipelineStepMetrics>> PipelineExecutionApi::stepMetric(utility::string_t programId, utility::string_t pipelineId, utility::string_t executionId, utility::string_t phaseId, utility::string_t stepId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution/{executionId}/phase/{phaseId}/step/{stepId}/metrics");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("executionId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(executionId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("phaseId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(phaseId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("stepId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(stepId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
    localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->stepMetric does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->stepMetric does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling stepMetric: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling stepMetric: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        std::shared_ptr<PipelineStepMetrics> localVarResult(new PipelineStepMetrics());

        if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json"))
        {
            web::json::value localVarJson = web::json::value::parse(localVarResponse);

            ModelBase::fromJson(localVarJson, localVarResult);
        }
        // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data"))
        // {
        // TODO multipart response parsing
        // }
        else
        {
            throw ApiException(500
                , utility::conversions::to_string_t("error calling stepMetric: unsupported response type"));
        }

        return localVarResult;
    });
}
pplx::task<std::shared_ptr<PipelineExecutionStepState>> PipelineExecutionApi::stepState(utility::string_t programId, utility::string_t pipelineId, utility::string_t executionId, utility::string_t phaseId, utility::string_t stepId, utility::string_t xGwImsOrgId, utility::string_t authorization, utility::string_t xApiKey) const
{

    std::shared_ptr<const ApiConfiguration> localVarApiConfiguration( m_ApiClient->getConfiguration() );
    utility::string_t localVarPath = utility::conversions::to_string_t("/api/program/{programId}/pipeline/{pipelineId}/execution/{executionId}/phase/{phaseId}/step/{stepId}");
    boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("programId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(programId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("pipelineId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(pipelineId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("executionId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(executionId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("phaseId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(phaseId));
boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("stepId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(stepId));

    std::map<utility::string_t, utility::string_t> localVarQueryParams;
    std::map<utility::string_t, utility::string_t> localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() );
    std::map<utility::string_t, utility::string_t> localVarFormParams;
    std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;

    std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
    localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") );

    utility::string_t localVarResponseHttpContentType;

    // use JSON if possible
    if ( localVarResponseHttpContentTypes.size() == 0 )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // JSON
    else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() )
    {
        localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(400, utility::conversions::to_string_t("PipelineExecutionApi->stepState does not produce any supported media type"));
    }

    localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType;

    std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;

    {
        localVarHeaderParams[utility::conversions::to_string_t("x-gw-ims-org-id")] = ApiClient::parameterToString(xGwImsOrgId);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("Authorization")] = ApiClient::parameterToString(authorization);
    }
    {
        localVarHeaderParams[utility::conversions::to_string_t("x-api-key")] = ApiClient::parameterToString(xApiKey);
    }

    std::shared_ptr<IHttpBody> localVarHttpBody;
    utility::string_t localVarRequestHttpContentType;

    // use JSON if possible
    if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("application/json");
    }
    // multipart formdata
    else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() )
    {
        localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data");
    }
    else
    {
        throw ApiException(415, utility::conversions::to_string_t("PipelineExecutionApi->stepState does not consume any supported media type"));
    }

    return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType)
    .then([=](web::http::http_response localVarResponse)
    {
        if (m_ApiClient->getResponseHandler())
        {
            m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers());
        }

        // 1xx - informational : OK
        // 2xx - successful       : OK
        // 3xx - redirection   : OK
        // 4xx - client error  : not OK
        // 5xx - client error  : not OK
        if (localVarResponse.status_code() >= 400)
        {
            throw ApiException(localVarResponse.status_code()
                , utility::conversions::to_string_t("error calling stepState: ") + localVarResponse.reason_phrase()
                , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
        }

        // check response content type
        if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type")))
        {
            utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")];
            if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos )
            {
                throw ApiException(500
                    , utility::conversions::to_string_t("error calling stepState: unexpected response type: ") + localVarContentType
                    , std::make_shared<std::stringstream>(localVarResponse.extract_utf8string(true).get()));
            }
        }

        return localVarResponse.extract_string();
    })
    .then([=](utility::string_t localVarResponse)
    {
        std::shared_ptr<PipelineExecutionStepState> localVarResult(new PipelineExecutionStepState());

        if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json"))
        {
            web::json::value localVarJson = web::json::value::parse(localVarResponse);

            ModelBase::fromJson(localVarJson, localVarResult);
        }
        // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data"))
        // {
        // TODO multipart response parsing
        // }
        else
        {
            throw ApiException(500
                , utility::conversions::to_string_t("error calling stepState: unsupported response type"));
        }

        return localVarResult;
    });
}

}
}
}
}

max_stars_repo_name: shinesolutions/cloudmanager-api-clients

max_issues_repo_name: shinesolutions/cloudmanager-api-clients

max_forks_repo_name: shinesolutions/cloudmanager-api-clients