text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>api_shim.core.http.HttpClient</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Trees

         Indices

         Help

        Package api_shim ::
        Package core ::
        Module http ::
        Class HttpClient

[hide private]

[frames] | no frames]

Class HttpClient

source code

              object --+
                       |
  ssl_support.SSLSupport --+
                           |
                  object --+
                           |
ssl_support.ClientSSLSupport --+
                               |
                  object --+   |
                           |   |
      tcp_support.TCPSupport --+
                               |
                      object --+
                               |
                              HttpClient

An HTTP client. A client maintains a pool of connections to a specific
  host, at a specific port. The HTTP connections can act as pipelines for
  HTTP requests. It is used as a factory for HttpClientRequest instances
  which encapsulate the actual HTTP requests. It is also used as a factory
  for HTML5 WebSocket websockets.

        Instance Methods
        [hide private]

          __init__(self,
        **kwargs)

            source code

          exception_handler(self,
        handler)

      Set the exception handler.

            source code

          get_max_pool_size(self)

      The maxium number of connections this client will pool.

            source code

          set_max_pool_size(self,
        val)

      Set the maximum pool size.

            source code

          get_keep_alive(self)

      Return if the client use keep alive.

            source code

          set_keep_alive(self,
        val)

      If val is true then, after the request has ended the connection will
      be returned to the pool where it can be used by another request.

            source code

          get_port(self)

      Return the port the client will attempt to .

            source code

          set_port(self,
        val)

      Set the port that the client will attempt to connect to on the server
      on.

            source code

          get_host(self)

            source code

          set_host(self,
        val)

      Set the host name or ip address that the client will attempt to
      connect to on the server on.

            source code

          get_verify_host(self)

            source code

          set_verify_host(self,
        val)

      If set then the client will try to validate the remote server's certificate
 hostname against the requested host.

            source code

          connect_web_socket(self,
        uri,
        handler)

      Attempt to connect an HTML5 websocket to the specified URI.

            source code

          get_now(self,
        uri,
        handler,
        **headers)

      This is a quick version of the get method where you do not want to do
      anything with the request before sing.

            source code

          options(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP OPTIONS request with the specified uri.

            source code

          get(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP GET request with the specified uri.

            source code

          head(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP HEAD request with the specified uri.

            source code

          post(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP POST request with the specified uri.

            source code

          put(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP PUT request with the specified uri.

            source code

          delete(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP DELETE request with the specified uri.

            source code

          trace(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP TRACE request with the specified uri.

            source code

          connect(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP CONNECT request with the specified uri.

            source code

          patch(self,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP PATCH request with the specified uri.

            source code

          request(self,
        method,
        uri,
        handler)

      This method returns an HttpClientRequest instance which represents an
      HTTP request with the specified method and uri.

            source code

          close(self)

      Close the client.

            source code

Inherited from ssl_support.ClientSSLSupport:
      get_trust_all,
      set_trust_all

Inherited from ssl_support.SSLSupport:
      get_key_store_password,
      get_key_store_path,
      get_ssl,
      get_trust_store_password,
      get_trust_store_path,
      set_key_store_password,
      set_key_store_path,
      set_ssl,
      set_trust_store_password,
      set_trust_store_path

Inherited from tcp_support.TCPSupport:
      get_receive_buffer_size,
      get_reuse_address,
      get_send_buffer_size,
      get_so_linger,
      get_tcp_keep_alive,
      get_tcp_no_delay,
      get_traffic_class,
      get_use_pooled_buffers,
      set_receive_buffer_size,
      set_reuse_address,
      set_send_buffer_size,
      set_so_linger,
      set_tcp_keep_alive,
      set_tcp_no_delay,
      set_traffic_class,
      set_use_pooled_buffers

        Class Variables
        [hide private]

        max_pool_size = property(get_max_pool_size, set_max_pool_size)

        keep_alive = property(get_keep_alive, set_keep_alive)

        port = property(get_port, set_port)

        host = property(get_host, set_host)

        verify_host = property(get_verify_host, set_verify_host)

Inherited from ssl_support.ClientSSLSupport:
      trust_all

Inherited from ssl_support.SSLSupport:
      key_store_password,
      key_store_path,
      ssl,
      trust_store_password,
      trust_store_path

Inherited from tcp_support.TCPSupport:
      receive_buffer_size,
      reuse_address,
      send_buffer_size,
      so_linger,
      tcp_keep_alive,
      tcp_no_delay,
      traffic_class,
      use_pooled_buffers

        Method Details
        [hide private]

__init__(self,
        **kwargs)

(Constructor)

  	source code

Overrides:
        object.__init__

(inherited documentation)

exception_handler(self,
        handler)

  	source code

Set the exception handler.

Keyword arguments:

Parameters:

handler - function to be used as the handler

set_max_pool_size(self,
        val)

  	source code

Set the maximum pool size. The client will maintain up to this number
  of HTTP connections in an internal pool

Keyword arguments:

Parameters:

val - The maximum number of connections (default to 1).

set_keep_alive(self,
        val)

  	source code

If val is true then, after the request has ended the connection will
  be returned to the pool where it can be used by another request. In this
  manner, many HTTP requests can be pipe-lined over an HTTP connection.
  Keep alive connections will not be closed until the close method is
  invoked. If val is false then a new connection will be created for each
  request and it won't ever go in the pool, the connection will closed
  after the response has been received. Even with no keep alive, the client
  will not allow more than max_pool_size connections to be created at any
  one time.

Keyword arguments:

Parameters:

val - The value to use for keep_alive

set_port(self,
        val)

  	source code

Set the port that the client will attempt to connect to on the server
  on. The default value is 80

Keyword arguments:

Parameters:

val - The port value.

set_host(self,
        val)

  	source code

Set the host name or ip address that the client will attempt to
  connect to on the server on.

Keyword arguments:

Parameters:

val - The host name or ip address to connect to.

set_verify_host(self,
        val)

  	source code

If set then the client will try to validate the remote server's certificate
 hostname against the requested host. Should default to 'true'.
 This method should only be used in SSL mode.

Keyword arguments:
@param val: true if verify hostname

connect_web_socket(self,
        uri,
        handler)

  	source code

Attempt to connect an HTML5 websocket to the specified URI. The
  connect is done asynchronously and the handler is called with a WebSocket
  on success.

Keyword arguments:

Parameters:

uri - A relative URI where to connect the websocket on the host, e.g.
          /some/path

handler - The handler to be called with the WebSocket

get_now(self,
        uri,
        handler,
        **headers)

  	source code

This is a quick version of the get method where you do not want to do
  anything with the request before sing. With this method the request is
  immediately sent. When an HTTP response is received from the server the
  handler is called passing in the response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the GET on the server.

handler - The handler to be called with the HttpClientResponse

headers - A dictionary of headers to pass with the request.

options(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP OPTIONS request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the OPTIONS on the server.

handler - The handler to be called with the HttpClientResponse

get(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP GET request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the GET on the server.

handler - The handler to be called with the HttpClientResponse

head(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP HEAD request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the HEAD on the server.

handler - The handler to be called with the HttpClientResponse

post(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP POST request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the POST on the server.

handler - The handler to be called with the HttpClientResponse

put(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP PUT request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the PUT on the server.

handler - The handler to be called with the HttpClientResponse

delete(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP DELETE request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the DELETE on the server.

handler - The handler to be called with the HttpClientResponse

trace(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP TRACE request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the TRACE on the server. handler.
          The handler to be called with the HttpClientResponse

connect(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP CONNECT request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the CONNECT on the server.

handler - The handler to be called with the HttpClientResponse

patch(self,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP PATCH request with the specified uri. When an HTTP response is
  received from the server the handler is called passing in the
  response.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the PATCH on the server.

handler - The handler to be called with the HttpClientResponse

request(self,
        method,
        uri,
        handler)

  	source code

This method returns an HttpClientRequest instance which represents an
  HTTP request with the specified method and uri. When an HTTP response is
  received from the server the handler is called passing in the response.
  method. The HTTP method. Can be one of OPTIONS, HEAD, GET, POST, PUT,
  DELETE, TRACE, CONNECT.

Keyword arguments:

Parameters:

uri - A relative URI where to perform the OPTIONS on the server.

handler - The handler to be called with the HttpClientResponse

close(self)

  	source code

Close the client. Any unclosed connections will be closed.

         Trees

         Indices

         Help

    Generated by Epydoc 3.0.1
    on Wed Jul 17 20:24:59 2013

      http://epydoc.sourceforge.net


text:
require 'test_helper'

######################################################################################################
# NOTE - AchDirect seems to return TEST APPROVAL for just about everything
######################################################################################################

class RemoteAchDirectTest < Test::Unit::TestCase

  def setup
    Base.mode = :test

    @gateway = AchDirectGateway.new(fixtures(:ach_direct))
    @amount = 100
    @credit_card = credit_card('4000100011112224')
    @options = {
      :order_id => generate_unique_id,
      :billing_address => address,
      :email => "joe@example.com",
      :customer => "1234"
    }
  end

  def test_bad_login
    gateway = AchDirectGateway.new({
      :login => '',
      :password => ''
    })
    assert response = gateway.purchase(@amount, @credit_card, @options)
    assert_equal 'INVALID MERCH', response.message
    assert_failure response
  end

  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_success response
    assert response.test?
    assert_equal 'TEST APPROVAL', response.message
    assert response.authorization
  end

  def test_invalid_amount
    assert response = @gateway.purchase(nil, @credit_card, @options)
    assert_equal 'INVALID AMOUNT', response.message
    assert_failure response
  end

  # def test_successful_credit
  #   assert response = @gateway.credit(@amount, @credit_card, @options)
  #   assert_success response
  #   assert response.test?
  #   assert_equal 'TEST APPROVAL', response.message
  #   assert response.authorization
  # end
  #
  # def test_unsuccessful_purchase
  #   assert response = @gateway.purchase(@amount, credit_card('4000300011112220'), @options)
  #   assert_equal 'AUTH DECLINE', response.message
  #   assert_failure response
  # end
  #
  # def test_authorize_and_capture
  #   assert auth = @gateway.authorize(@amount, @credit_card, @options)
  #   assert_success auth
  #   assert_equal 'TEST APPROVAL', auth.message
  #   assert auth.authorization
  #   assert capture = @gateway.capture(@amount, auth.authorization, @options)
  #   assert_success capture
  # end

end

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

	<?php include('partials/head.php'); ?>

	<?php include('partials/rocket.php'); ?>

	<?php include('partials/sticky-nav.php'); ?>

	<?php include('partials/about.php'); ?>

	<?php include('partials/speakers.php'); ?>

	<?php include('partials/panel.php'); ?>

	<?php include('partials/venue.php'); ?>

	<?php include('partials/sponsors.php'); ?>

	<?php include('partials/organizers.php'); ?>

    <?php include('partials/register.php'); ?>


text:
function(cgen_cps_on_load)
  event_addhandler(cutil_on_load cgen_cutil_on_load)

endfunction()


text:
namespace AlexaDo
{
    partial class TestCommand
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
                components?.Dispose();

            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.CommandText = new System.Windows.Forms.TextBox();
            this.CancelTestButton = new System.Windows.Forms.Button();
            this.ExecuteTestButton = new System.Windows.Forms.Button();
            this.SuspendLayout();
            //
            // CommandText
            //
            this.CommandText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.CommandText.Location = new System.Drawing.Point(13, 13);
            this.CommandText.Multiline = true;
            this.CommandText.Name = "CommandText";
            this.CommandText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.CommandText.Size = new System.Drawing.Size(372, 67);
            this.CommandText.TabIndex = 0;
            this.CommandText.Text = "Simon Says enter command text to test";
            //
            // CancelTestButton
            //
            this.CancelTestButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.CancelTestButton.Location = new System.Drawing.Point(310, 86);
            this.CancelTestButton.Name = "CancelTestButton";
            this.CancelTestButton.Size = new System.Drawing.Size(75, 23);
            this.CancelTestButton.TabIndex = 2;
            this.CancelTestButton.Text = "&Cancel";
            this.CancelTestButton.UseVisualStyleBackColor = true;
            //
            // ExecuteTestButton
            //
            this.ExecuteTestButton.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.ExecuteTestButton.Location = new System.Drawing.Point(228, 86);
            this.ExecuteTestButton.Name = "ExecuteTestButton";
            this.ExecuteTestButton.Size = new System.Drawing.Size(75, 23);
            this.ExecuteTestButton.TabIndex = 1;
            this.ExecuteTestButton.Text = "&Test";
            this.ExecuteTestButton.UseVisualStyleBackColor = true;
            this.ExecuteTestButton.Click += new System.EventHandler(this.ExecuteTestButton_Click);
            //
            // TestCommand
            //
            this.AcceptButton = this.ExecuteTestButton;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.CancelTestButton;
            this.ClientSize = new System.Drawing.Size(397, 116);
            this.ControlBox = false;
            this.Controls.Add(this.ExecuteTestButton);
            this.Controls.Add(this.CancelTestButton);
            this.Controls.Add(this.CommandText);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "TestCommand";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "Test Command";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button CancelTestButton;
        private System.Windows.Forms.Button ExecuteTestButton;
        internal System.Windows.Forms.TextBox CommandText;
    }
}


text:
#ifndef _TCUWGLCONTEXTFACTORY_HPP
#define _TCUWGLCONTEXTFACTORY_HPP
/*!
 * \file
 * \brief WGL GL context factory.
 *//*--------------------------------------------------------------------*/

#include "tcuDefs.hpp"
#include "gluContextFactory.hpp"
#include "tcuWGL.hpp"

namespace tcu
{

class WGLContextFactory : public glu::ContextFactory
{
public:
								WGLContextFactory	(HINSTANCE instance);
	virtual glu::RenderContext*	createContext		(const glu::RenderConfig& config, const tcu::CommandLine& cmdLine) const;

private:
	HINSTANCE					m_instance;
	wgl::Core					m_wglCore;
};

} // tcu

#endif // _TCUWGLCONTEXTFACTORY_HPP


text:
package de.bornemisza.ds.rest.security;

import de.bornemisza.ds.rest.security.HashProvider;
import org.junit.Before;
import org.junit.Test;
import org.primeframework.jwt.domain.JWT;
import static org.junit.Assert.*;

public class HashProviderTest {

    private HashProvider CUT;
    private String testMessage;

    public HashProviderTest() {
    }

    @Before
    public void setUp() {
        CUT = new HashProviderImpl();
        testMessage = "My Test " + System.currentTimeMillis();
    }

    @Test
    public void digestIsPredictable() throws Exception {
        String hmac = CUT.hmacDigest(testMessage);
        for (int i = 0; i < 100; i++) {
            assertEquals(hmac, CUT.hmacDigest(testMessage));
        }
        CUT = new HashProviderImpl();
        for (int i = 0; i < 100; i++) {
            assertEquals(hmac, CUT.hmacDigest(testMessage));
        }
    }

    @Test
    public void encodeDecodeJasonWebToken() {
        String userName = "Drombo van Cleefy";
        String encodedJWT = CUT.encodeJasonWebToken(userName);
        JWT jwt = CUT.decodeJasonWebToken(encodedJWT);
        assertEquals(userName, jwt.subject);
    }

    public final class HashProviderImpl extends HashProvider {

        public HashProviderImpl() {
            super();
            init();
        }

        @Override
        protected char[] getServerSecret() {
            return "My Secret Password".toCharArray();
        }

    }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Azure.Management.Search.Fluent;
using Microsoft.Azure.Management.Search.Fluent.Models;
using Microsoft.Azure.Management.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent.Authentication;
using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
using Microsoft.Azure.Management.Samples.Common;
using System;

namespace ManageSearch
{
    public class Program
    {
        private static readonly Region Region = Region.USEast;

        /**
         * Azure Search sample for managing search service.
         *  - Create a Search service resource with a free SKU
         *  - Create a Search service resource with a standard SKU, one replica and one partition
         *  - Create a new query key and delete a query key
         *  - Update the Search service with three replicas and three partitions
         *  - Regenerate the primary and secondary admin keys
         *  - Delete the Search service
         */
        public static void RunSample(IAzure azure)
        {
            string rgName = SdkContext.RandomResourceName("rgSearch", 15);
            string searchServiceName = SdkContext.RandomResourceName("search", 20);

            try
            {
                //=============================================================
                // Check if the name for the Azure Search service to be created is available

                if (!azure.SearchServices.CheckNameAvailability(searchServiceName).IsAvailable)
                {
                    throw new Exception("Search service name is not available: " + searchServiceName);
                }

                // Azure limits the number of free Search service resource to one per subscription
                // List all Search services in the subscription and skip if there is already one resource of type free SKU
                var createFreeService = true;
                var resources = azure.SearchServices.List();
                foreach (var item in resources)
                {
                    if (item.Sku.Name.Equals(Microsoft.Azure.Management.Search.Fluent.Models.SkuName.Free))
                    {
                        createFreeService = false;
                        break;
                    }
                }

                if (createFreeService)
                {
                    //=============================================================
                    // Create a Azure Search service resource with a "free" SKU

                    Utilities.Log("Creating an Azure Search service using \"free\" SKU");

                    ISearchService searchServiceFree = azure.SearchServices.Define(searchServiceName + "free")
                        .WithRegion(Region)
                        .WithNewResourceGroup(rgName)
                        .WithFreeSku()
                        .Create();

                    Utilities.Log("Created Azure Search service with free SKU: " + searchServiceFree.Id);
                    Utilities.Print(searchServiceFree);
                }

                //=============================================================
                // Create an Azure Search service resource of type Standard SKU

                Utilities.Log("Creating an Azure Search service");

                ISearchService searchService = azure.SearchServices.Define(searchServiceName)
                        .WithRegion(Region)
                        .WithNewResourceGroup(rgName)
                        .WithStandardSku()
                        .WithPartitionCount(1)
                        .WithReplicaCount(1)
                        .Create();

                Utilities.Log("Created Azure Search service with standard SKU: " + searchService.Id);
                Utilities.Print(searchService);

                //=============================================================
                // Iterate through the Azure Search service resources

                Utilities.Log("List all the Azure Search services for a given resource group");

                foreach (ISearchService service in azure.SearchServices.ListByResourceGroup(rgName))
                {
                    Utilities.Print(service);
                }

                //=============================================================
                // Add a query key for the Search service resource

                Utilities.Log("Add a query key to an Azure Search service");

                searchService.CreateQueryKey("testKey1");

                //=============================================================
                // Regenerate the admin keys for an Azure Search service resource

                Utilities.Log("Regenerate the admin keys for an Azure Search service");

                searchService.RegenerateAdminKeys(AdminKeyKind.Primary);
                searchService.RegenerateAdminKeys(AdminKeyKind.Secondary);

                //=============================================================
                // Update the Search service to use three replicas and three partitions and update the tags

                Utilities.Log("Update an Azure Search service");

                searchService = searchService.Update()
                        .WithTag("tag2", "value2")
                        .WithTag("tag3", "value3")
                        .WithoutTag("tag1")
                        .WithReplicaCount(1)
                        .WithPartitionCount(2)
                        .Apply();

                Utilities.Print(searchService);

                //=============================================================
                // Delete a query key for an Azure Search service resource

                Utilities.Log("Delete a query key for an Azure Search service");

                searchService.DeleteQueryKey(searchService.ListQueryKeys()[1].Key);

                Utilities.Print(searchService);

                //=============================================================
                // Delete the Search service resource

                Utilities.Log("Delete an Azure Search service resource");

                azure.SearchServices.DeleteByResourceGroup(rgName, searchServiceName);

            }
            finally
            {
                try
                {
                    Utilities.Log("Deleting Resource Group: " + rgName);
                    azure.ResourceGroups.BeginDeleteByName(rgName);
                    Utilities.Log("Deleted Resource Group: " + rgName);
                }
                catch (Exception)
                {
                    Utilities.Log("Did not create any resources in Azure. No clean up is necessary");
                }
            }
        }

        public static void Main(string[] args)
        {
            try
            {
                //=================================================================
                // Authenticate
                AzureCredentials credentials = SdkContext.AzureCredentialsFactory.FromFile(Environment.GetEnvironmentVariable("AZURE_AUTH_LOCATION"));

                var azure = Azure
                    .Configure()
                    .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
                    .Authenticate(credentials)
                    .WithDefaultSubscription();

                // Print selected subscription
                Utilities.Log("Selected subscription: " + azure.SubscriptionId);

                RunSample(azure);
            }
            catch (Exception ex)
            {
                Utilities.Log(ex);
            }
        }
    }
}