text: 'use strict';
  
  /* jshint ignore:start */
  /**
   * This code was generated by
   * \ / _    _  _|   _  _
   *  | (_)\/(_)(_|\/| |(/_  v1.0.0
   *       /       /
   */
  /* jshint ignore:end */
  
  var _ = require('lodash');  /* jshint ignore:line */
  var Holodeck = require('../../../holodeck');  /* jshint ignore:line */
  var Request = require(
      '../../../../../lib/http/request');  /* jshint ignore:line */
  var Response = require(
      '../../../../../lib/http/response');  /* jshint ignore:line */
  var RestException = require(
      '../../../../../lib/base/RestException');  /* jshint ignore:line */
  var Twilio = require('../../../../../lib');  /* jshint ignore:line */
  
  
  var client;
  var holodeck;
  
  describe('Flow', function() {
    beforeEach(function() {
      holodeck = new Holodeck();
      client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', {
        httpClient: holodeck
      });
    });
    it('should generate valid list request',
      function() {
        holodeck.mock(new Response(500, '{}'));
  
        var promise = client.preview.studio.flows.list();
        promise = promise.then(function() {
          throw new Error('failed');
        }, function(error) {
          expect(error.constructor).toBe(RestException.prototype.constructor);
        });
        promise.done();
  
        var url = 'https://preview.twilio.com/Studio/Flows';
  
        holodeck.assertHasRequest(new Request({
          method: 'GET',
          url: url
        }));
      }
    );
    it('should generate valid read_empty response',
      function() {
        var body = JSON.stringify({
            'meta': {
                'previous_page_url': null,
                'next_page_url': null,
                'url': 'https://preview.twilio.com/Studio/Flows?PageSize=50&Page=0',
                'page': 0,
                'first_page_url': 'https://preview.twilio.com/Studio/Flows?PageSize=50&Page=0',
                'page_size': 50,
                'key': 'flows'
            },
            'flows': []
        });
  
        holodeck.mock(new Response(200, body));
  
        var promise = client.preview.studio.flows.list();
        promise = promise.then(function(response) {
          expect(response).toBeDefined();
        }, function() {
          throw new Error('failed');
        });
  
        promise.done();
      }
    );
    it('should generate valid fetch request',
      function() {
        holodeck.mock(new Response(500, '{}'));
  
        var promise = client.preview.studio.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch();
        promise = promise.then(function() {
          throw new Error('failed');
        }, function(error) {
          expect(error.constructor).toBe(RestException.prototype.constructor);
        });
        promise.done();
  
        var solution = {sid: 'FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'};
        var url = _.template('https://preview.twilio.com/Studio/Flows/<%= sid %>')(solution);
  
        holodeck.assertHasRequest(new Request({
          method: 'GET',
          url: url
        }));
      }
    );
    it('should generate valid fetch response',
      function() {
        var body = JSON.stringify({
            'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'friendly_name': 'Test Flow',
            'status': 'published',
            'debug': false,
            'version': 1,
            'date_created': '2017-11-06T12:00:00Z',
            'date_updated': null,
            'url': 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'links': {
                'engagements': 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements'
            }
        });
  
        holodeck.mock(new Response(200, body));
  
        var promise = client.preview.studio.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch();
        promise = promise.then(function(response) {
          expect(response).toBeDefined();
        }, function() {
          throw new Error('failed');
        });
  
        promise.done();
      }
    );
    it('should generate valid remove request',
      function() {
        holodeck.mock(new Response(500, '{}'));
  
        var promise = client.preview.studio.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();
        promise = promise.then(function() {
          throw new Error('failed');
        }, function(error) {
          expect(error.constructor).toBe(RestException.prototype.constructor);
        });
        promise.done();
  
        var solution = {sid: 'FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'};
        var url = _.template('https://preview.twilio.com/Studio/Flows/<%= sid %>')(solution);
  
        holodeck.assertHasRequest(new Request({
          method: 'DELETE',
          url: url
        }));
      }
    );
    it('should generate valid delete response',
      function() {
        var body = JSON.stringify(null);
  
        holodeck.mock(new Response(204, body));
  
        var promise = client.preview.studio.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();
        promise = promise.then(function(response) {
          expect(response).toBe(true);
        }, function() {
          throw new Error('failed');
        });
  
        promise.done();
      }
    );
  });
  