text:
using gax = Google.Api.Gax;
using gaxgrpc = Google.Api.Gax.Grpc;

using lro = Google.LongRunning;
using proto = Google.Protobuf;
using grpccore = Grpc.Core;
using grpcinter = Grpc.Core.Interceptors;
using sys = System;
using sc = System.Collections;
using scg = System.Collections.Generic;
using sco = System.Collections.ObjectModel;
using st = System.Threading;
using stt = System.Threading.Tasks;

namespace Google.Cloud.Compute.V1
{
    /// Settings for <see cref="RoutesClient"/> instances.
    public sealed partial class RoutesSettings : gaxgrpc::ServiceSettingsBase
    {
        /// Get a new instance of the default <see cref="RoutesSettings"/>.
        /// <returns>A new instance of the default <see cref="RoutesSettings"/>.</returns>
        public static RoutesSettings GetDefault() => new RoutesSettings();

        /// Constructs a new <see cref="RoutesSettings"/> object with default settings.
        public RoutesSettings()
        {
        }

        private RoutesSettings(RoutesSettings existing) : base(existing)
        {
            gax::GaxPreconditions.CheckNotNull(existing, nameof(existing));
            DeleteSettings = existing.DeleteSettings;
            DeleteOperationsSettings = existing.DeleteOperationsSettings.Clone();
            GetSettings = existing.GetSettings;
            InsertSettings = existing.InsertSettings;
            InsertOperationsSettings = existing.InsertOperationsSettings.Clone();
            ListSettings = existing.ListSettings;
            OnCopy(existing);
        }

        partial void OnCopy(RoutesSettings existing);

        ///
        /// <see cref="gaxgrpc::CallSettings"/> for synchronous and asynchronous calls to <c>RoutesClient.Delete</c> and
        /// <c>RoutesClient.DeleteAsync</c>.
        ///
        /// <remarks>
        /// <list type="bullet">
        /// <item><description>This call will not be retried.</description></item>
        /// <item><description>Timeout: 600 seconds.</description></item>
        /// </list>
        /// </remarks>
        public gaxgrpc::CallSettings DeleteSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000)));

        ///
        /// Long Running Operation settings for calls to <c>RoutesClient.Delete</c> and <c>RoutesClient.DeleteAsync</c>.
        ///
        /// <remarks>
        /// Uses default <see cref="gax::PollSettings"/> of:
        /// <list type="bullet">
        /// <item><description>Initial delay: 20 seconds.</description></item>
        /// <item><description>Delay multiplier: 1.5</description></item>
        /// <item><description>Maximum delay: 45 seconds.</description></item>
        /// <item><description>Total timeout: 24 hours.</description></item>
        /// </list>
        /// </remarks>
        public lro::OperationsSettings DeleteOperationsSettings { get; set; } = new lro::OperationsSettings
        {
            DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)),
        };

        ///
        /// <see cref="gaxgrpc::CallSettings"/> for synchronous and asynchronous calls to <c>RoutesClient.Get</c> and
        /// <c>RoutesClient.GetAsync</c>.
        ///
        /// <remarks>
        /// <list type="bullet">
        /// <item><description>Initial retry delay: 100 milliseconds.</description></item>
        /// <item><description>Retry delay multiplier: 1.3</description></item>
        /// <item><description>Retry maximum delay: 60000 milliseconds.</description></item>
        /// <item><description>Maximum attempts: Unlimited</description></item>
        /// <item>
        /// <description>
        /// Retriable status codes: <see cref="grpccore::StatusCode.DeadlineExceeded"/>,
        /// <see cref="grpccore::StatusCode.Unavailable"/>.
        /// </description>
        /// </item>
        /// <item><description>Timeout: 600 seconds.</description></item>
        /// </list>
        /// </remarks>
        public gaxgrpc::CallSettings GetSettings { get; set; } = gaxgrpc::CallSettingsExtensions.WithRetry(gaxgrpc::CallSettings.FromExpiration(gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000))), gaxgrpc::RetrySettings.FromExponentialBackoff(maxAttempts: 2147483647, initialBackoff: sys::TimeSpan.FromMilliseconds(100), maxBackoff: sys::TimeSpan.FromMilliseconds(60000), backoffMultiplier: 1.3, retryFilter: gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable)));

        ///
        /// <see cref="gaxgrpc::CallSettings"/> for synchronous and asynchronous calls to <c>RoutesClient.Insert</c> and
        /// <c>RoutesClient.InsertAsync</c>.
        ///
        /// <remarks>
        /// <list type="bullet">
        /// <item><description>This call will not be retried.</description></item>
        /// <item><description>Timeout: 600 seconds.</description></item>
        /// </list>
        /// </remarks>
        public gaxgrpc::CallSettings InsertSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000)));

        ///
        /// Long Running Operation settings for calls to <c>RoutesClient.Insert</c> and <c>RoutesClient.InsertAsync</c>.
        ///
        /// <remarks>
        /// Uses default <see cref="gax::PollSettings"/> of:
        /// <list type="bullet">
        /// <item><description>Initial delay: 20 seconds.</description></item>
        /// <item><description>Delay multiplier: 1.5</description></item>
        /// <item><description>Maximum delay: 45 seconds.</description></item>
        /// <item><description>Total timeout: 24 hours.</description></item>
        /// </list>
        /// </remarks>
        public lro::OperationsSettings InsertOperationsSettings { get; set; } = new lro::OperationsSettings
        {
            DefaultPollSettings = new gax::PollSettings(gax::Expiration.FromTimeout(sys::TimeSpan.FromHours(24)), sys::TimeSpan.FromSeconds(20), 1.5, sys::TimeSpan.FromSeconds(45)),
        };

        ///
        /// <see cref="gaxgrpc::CallSettings"/> for synchronous and asynchronous calls to <c>RoutesClient.List</c> and
        /// <c>RoutesClient.ListAsync</c>.
        ///
        /// <remarks>
        /// <list type="bullet">
        /// <item><description>Initial retry delay: 100 milliseconds.</description></item>
        /// <item><description>Retry delay multiplier: 1.3</description></item>
        /// <item><description>Retry maximum delay: 60000 milliseconds.</description></item>
        /// <item><description>Maximum attempts: Unlimited</description></item>
        /// <item>
        /// <description>
        /// Retriable status codes: <see cref="grpccore::StatusCode.DeadlineExceeded"/>,
        /// <see cref="grpccore::StatusCode.Unavailable"/>.
        /// </description>
        /// </item>
        /// <item><description>Timeout: 600 seconds.</description></item>
        /// </list>
        /// </remarks>
        public gaxgrpc::CallSettings ListSettings { get; set; } = gaxgrpc::CallSettingsExtensions.WithRetry(gaxgrpc::CallSettings.FromExpiration(gax::Expiration.FromTimeout(sys::TimeSpan.FromMilliseconds(600000))), gaxgrpc::RetrySettings.FromExponentialBackoff(maxAttempts: 2147483647, initialBackoff: sys::TimeSpan.FromMilliseconds(100), maxBackoff: sys::TimeSpan.FromMilliseconds(60000), backoffMultiplier: 1.3, retryFilter: gaxgrpc::RetrySettings.FilterForStatusCodes(grpccore::StatusCode.DeadlineExceeded, grpccore::StatusCode.Unavailable)));

        /// Creates a deep clone of this object, with all the same property values.
        /// <returns>A deep clone of this <see cref="RoutesSettings"/> object.</returns>
        public RoutesSettings Clone() => new RoutesSettings(this);
    }

    ///
    /// Builder class for <see cref="RoutesClient"/> to provide simple configuration of credentials, endpoint etc.
    ///
    public sealed partial class RoutesClientBuilder : gaxgrpc::ClientBuilderBase<RoutesClient>
    {
        /// The settings to use for RPCs, or <c>null</c> for the default settings.
        public RoutesSettings Settings { get; set; }

        /// Creates a new builder with default settings.
        public RoutesClientBuilder()
        {
            UseJwtAccessWithScopes = RoutesClient.UseJwtAccessWithScopes;
        }

        partial void InterceptBuild(ref RoutesClient client);

        partial void InterceptBuildAsync(st::CancellationToken cancellationToken, ref stt::Task<RoutesClient> task);

        /// Builds the resulting client.
        public override RoutesClient Build()
        {
            RoutesClient client = null;
            InterceptBuild(ref client);
            return client ?? BuildImpl();
        }

        /// Builds the resulting client asynchronously.
        public override stt::Task<RoutesClient> BuildAsync(st::CancellationToken cancellationToken = default)
        {
            stt::Task<RoutesClient> task = null;
            InterceptBuildAsync(cancellationToken, ref task);
            return task ?? BuildAsyncImpl(cancellationToken);
        }

        private RoutesClient BuildImpl()
        {
            Validate();
            grpccore::CallInvoker callInvoker = CreateCallInvoker();
            return RoutesClient.Create(callInvoker, Settings);
        }

        private async stt::Task<RoutesClient> BuildAsyncImpl(st::CancellationToken cancellationToken)
        {
            Validate();
            grpccore::CallInvoker callInvoker = await CreateCallInvokerAsync(cancellationToken).ConfigureAwait(false);
            return RoutesClient.Create(callInvoker, Settings);
        }

        /// Returns the endpoint for this builder type, used if no endpoint is otherwise specified.
        protected override string GetDefaultEndpoint() => RoutesClient.DefaultEndpoint;

        ///
        /// Returns the default scopes for this builder type, used if no scopes are otherwise specified.
        ///
        protected override scg::IReadOnlyList<string> GetDefaultScopes() => RoutesClient.DefaultScopes;

        /// Returns the channel pool to use when no other options are specified.
        protected override gaxgrpc::ChannelPool GetChannelPool() => RoutesClient.ChannelPool;

        /// Returns the default <see cref="gaxgrpc::GrpcAdapter"/>to use if not otherwise specified.
        protected override gaxgrpc::GrpcAdapter DefaultGrpcAdapter => ComputeRestAdapter.ComputeAdapter;
    }

    /// Routes client wrapper, for convenient use.
    /// <remarks>
    /// The Routes API.
    /// </remarks>
    public abstract partial class RoutesClient
    {
        ///
        /// The default endpoint for the Routes service, which is a host of "compute.googleapis.com" and a port of 443.
        ///
        public static string DefaultEndpoint { get; } = "compute.googleapis.com:443";

        /// The default Routes scopes.
        /// <remarks>
        /// The default Routes scopes are:
        /// <list type="bullet">
        /// <item><description>https://www.googleapis.com/auth/compute</description></item>
        /// <item><description>https://www.googleapis.com/auth/cloud-platform</description></item>
        /// </list>
        /// </remarks>
        public static scg::IReadOnlyList<string> DefaultScopes { get; } = new sco::ReadOnlyCollection<string>(new string[]
        {
            "https://www.googleapis.com/auth/compute",
            "https://www.googleapis.com/auth/cloud-platform",
        });

        internal static gaxgrpc::ChannelPool ChannelPool { get; } = new gaxgrpc::ChannelPool(DefaultScopes, UseJwtAccessWithScopes);

        internal static bool UseJwtAccessWithScopes
        {
            get
            {
                bool useJwtAccessWithScopes = true;
                MaybeUseJwtAccessWithScopes(ref useJwtAccessWithScopes);
                return useJwtAccessWithScopes;
            }
        }

        static partial void MaybeUseJwtAccessWithScopes(ref bool useJwtAccessWithScopes);

        ///
        /// Asynchronously creates a <see cref="RoutesClient"/> using the default credentials, endpoint and settings. To
        /// specify custom credentials or other settings, use <see cref="RoutesClientBuilder"/>.
        ///
        /// <param name="cancellationToken">
        /// The <see cref="st::CancellationToken"/> to use while creating the client.
        /// </param>
        /// <returns>The task representing the created <see cref="RoutesClient"/>.</returns>
        public static stt::Task<RoutesClient> CreateAsync(st::CancellationToken cancellationToken = default) =>
            new RoutesClientBuilder().BuildAsync(cancellationToken);

        ///
        /// Synchronously creates a <see cref="RoutesClient"/> using the default credentials, endpoint and settings. To
        /// specify custom credentials or other settings, use <see cref="RoutesClientBuilder"/>.
        ///
        /// <returns>The created <see cref="RoutesClient"/>.</returns>
        public static RoutesClient Create() => new RoutesClientBuilder().Build();

        ///
        /// Creates a <see cref="RoutesClient"/> which uses the specified call invoker for remote operations.
        ///
        /// <param name="callInvoker">
        /// The <see cref="grpccore::CallInvoker"/> for remote operations. Must not be null.
        /// </param>
        /// <param name="settings">Optional <see cref="RoutesSettings"/>.</param>
        /// <returns>The created <see cref="RoutesClient"/>.</returns>
        internal static RoutesClient Create(grpccore::CallInvoker callInvoker, RoutesSettings settings = null)
        {
            gax::GaxPreconditions.CheckNotNull(callInvoker, nameof(callInvoker));
            grpcinter::Interceptor interceptor = settings?.Interceptor;
            if (interceptor != null)
            {
                callInvoker = grpcinter::CallInvokerExtensions.Intercept(callInvoker, interceptor);
            }
            Routes.RoutesClient grpcClient = new Routes.RoutesClient(callInvoker);
            return new RoutesClientImpl(grpcClient, settings);
        }

        ///
        /// Shuts down any channels automatically created by <see cref="Create()"/> and
        /// <see cref="CreateAsync(st::CancellationToken)"/>. Channels which weren't automatically created are not
        /// affected.
        ///
        /// <remarks>
        /// After calling this method, further calls to <see cref="Create()"/> and
        /// <see cref="CreateAsync(st::CancellationToken)"/> will create new channels, which could in turn be shut down
        /// by another call to this method.
        /// </remarks>
        /// <returns>A task representing the asynchronous shutdown operation.</returns>
        public static stt::Task ShutdownDefaultChannelsAsync() => ChannelPool.ShutdownChannelsAsync();

        /// The underlying gRPC Routes client
        public virtual Routes.RoutesClient GrpcClient => throw new sys::NotImplementedException();

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public virtual lro::Operation<Operation, Operation> Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> DeleteAsync(DeleteRouteRequest request, st::CancellationToken cancellationToken) =>
            DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));

        /// The long-running operations client for <c>Delete</c>.
        public virtual lro::OperationsClient DeleteOperationsClient => throw new sys::NotImplementedException();

        ///
        /// Poll an operation once, using an <c>operationName</c> from a previous invocation of <c>Delete</c>.
        ///
        /// <param name="operationName">
        /// The name of a previously invoked operation. Must not be <c>null</c> or empty.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The result of polling the operation.</returns>
        public virtual lro::Operation<Operation, Operation> PollOnceDelete(string operationName, gaxgrpc::CallSettings callSettings = null) =>
            lro::Operation<Operation, Operation>.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings);

        ///
        /// Asynchronously poll an operation once, using an <c>operationName</c> from a previous invocation of <c>Delete</c>
        /// .
        ///
        /// <param name="operationName">
        /// The name of a previously invoked operation. Must not be <c>null</c> or empty.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A task representing the result of polling the operation.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> PollOnceDeleteAsync(string operationName, gaxgrpc::CallSettings callSettings = null) =>
            lro::Operation<Operation, Operation>.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), DeleteOperationsClient, callSettings);

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="route">
        /// Name of the Route resource to delete.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public virtual lro::Operation<Operation, Operation> Delete(string project, string route, gaxgrpc::CallSettings callSettings = null) =>
            Delete(new DeleteRouteRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                Route = gax::GaxPreconditions.CheckNotNullOrEmpty(route, nameof(route)),
            }, callSettings);

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="route">
        /// Name of the Route resource to delete.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> DeleteAsync(string project, string route, gaxgrpc::CallSettings callSettings = null) =>
            DeleteAsync(new DeleteRouteRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                Route = gax::GaxPreconditions.CheckNotNullOrEmpty(route, nameof(route)),
            }, callSettings);

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="route">
        /// Name of the Route resource to delete.
        /// </param>
        /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> DeleteAsync(string project, string route, st::CancellationToken cancellationToken) =>
            DeleteAsync(project, route, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public virtual Route Get(GetRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<Route> GetAsync(GetRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<Route> GetAsync(GetRouteRequest request, st::CancellationToken cancellationToken) =>
            GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="route">
        /// Name of the Route resource to return.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public virtual Route Get(string project, string route, gaxgrpc::CallSettings callSettings = null) =>
            Get(new GetRouteRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                Route = gax::GaxPreconditions.CheckNotNullOrEmpty(route, nameof(route)),
            }, callSettings);

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="route">
        /// Name of the Route resource to return.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<Route> GetAsync(string project, string route, gaxgrpc::CallSettings callSettings = null) =>
            GetAsync(new GetRouteRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                Route = gax::GaxPreconditions.CheckNotNullOrEmpty(route, nameof(route)),
            }, callSettings);

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="route">
        /// Name of the Route resource to return.
        /// </param>
        /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<Route> GetAsync(string project, string route, st::CancellationToken cancellationToken) =>
            GetAsync(project, route, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public virtual lro::Operation<Operation, Operation> Insert(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> InsertAsync(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> InsertAsync(InsertRouteRequest request, st::CancellationToken cancellationToken) =>
            InsertAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));

        /// The long-running operations client for <c>Insert</c>.
        public virtual lro::OperationsClient InsertOperationsClient => throw new sys::NotImplementedException();

        ///
        /// Poll an operation once, using an <c>operationName</c> from a previous invocation of <c>Insert</c>.
        ///
        /// <param name="operationName">
        /// The name of a previously invoked operation. Must not be <c>null</c> or empty.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The result of polling the operation.</returns>
        public virtual lro::Operation<Operation, Operation> PollOnceInsert(string operationName, gaxgrpc::CallSettings callSettings = null) =>
            lro::Operation<Operation, Operation>.PollOnceFromName(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings);

        ///
        /// Asynchronously poll an operation once, using an <c>operationName</c> from a previous invocation of <c>Insert</c>
        /// .
        ///
        /// <param name="operationName">
        /// The name of a previously invoked operation. Must not be <c>null</c> or empty.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A task representing the result of polling the operation.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> PollOnceInsertAsync(string operationName, gaxgrpc::CallSettings callSettings = null) =>
            lro::Operation<Operation, Operation>.PollOnceFromNameAsync(gax::GaxPreconditions.CheckNotNullOrEmpty(operationName, nameof(operationName)), InsertOperationsClient, callSettings);

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="routeResource">
        /// The body resource for this request
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public virtual lro::Operation<Operation, Operation> Insert(string project, Route routeResource, gaxgrpc::CallSettings callSettings = null) =>
            Insert(new InsertRouteRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                RouteResource = gax::GaxPreconditions.CheckNotNull(routeResource, nameof(routeResource)),
            }, callSettings);

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="routeResource">
        /// The body resource for this request
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> InsertAsync(string project, Route routeResource, gaxgrpc::CallSettings callSettings = null) =>
            InsertAsync(new InsertRouteRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                RouteResource = gax::GaxPreconditions.CheckNotNull(routeResource, nameof(routeResource)),
            }, callSettings);

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="routeResource">
        /// The body resource for this request
        /// </param>
        /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public virtual stt::Task<lro::Operation<Operation, Operation>> InsertAsync(string project, Route routeResource, st::CancellationToken cancellationToken) =>
            InsertAsync(project, routeResource, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));

        ///
        /// Retrieves the list of Route resources available to the specified project.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable sequence of <see cref="Route"/> resources.</returns>
        public virtual gax::PagedEnumerable<RouteList, Route> List(ListRoutesRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Retrieves the list of Route resources available to the specified project.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable asynchronous sequence of <see cref="Route"/> resources.</returns>
        public virtual gax::PagedAsyncEnumerable<RouteList, Route> ListAsync(ListRoutesRequest request, gaxgrpc::CallSettings callSettings = null) =>
            throw new sys::NotImplementedException();

        ///
        /// Retrieves the list of Route resources available to the specified project.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="pageToken">
        /// The token returned from the previous request. A value of <c>null</c> or an empty string retrieves the first
        /// page.
        /// </param>
        /// <param name="pageSize">
        /// The size of page to request. The response will not be larger than this, but may be smaller. A value of
        /// <c>null</c> or <c>0</c> uses a server-defined page size.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable sequence of <see cref="Route"/> resources.</returns>
        public virtual gax::PagedEnumerable<RouteList, Route> List(string project, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) =>
            List(new ListRoutesRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                PageToken = pageToken ?? "",
                PageSize = pageSize ?? 0,
            }, callSettings);

        ///
        /// Retrieves the list of Route resources available to the specified project.
        ///
        /// <param name="project">
        /// Project ID for this request.
        /// </param>
        /// <param name="pageToken">
        /// The token returned from the previous request. A value of <c>null</c> or an empty string retrieves the first
        /// page.
        /// </param>
        /// <param name="pageSize">
        /// The size of page to request. The response will not be larger than this, but may be smaller. A value of
        /// <c>null</c> or <c>0</c> uses a server-defined page size.
        /// </param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable asynchronous sequence of <see cref="Route"/> resources.</returns>
        public virtual gax::PagedAsyncEnumerable<RouteList, Route> ListAsync(string project, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = null) =>
            ListAsync(new ListRoutesRequest
            {
                Project = gax::GaxPreconditions.CheckNotNullOrEmpty(project, nameof(project)),
                PageToken = pageToken ?? "",
                PageSize = pageSize ?? 0,
            }, callSettings);
    }

    /// Routes client wrapper implementation, for convenient use.
    /// <remarks>
    /// The Routes API.
    /// </remarks>
    public sealed partial class RoutesClientImpl : RoutesClient
    {
        private readonly gaxgrpc::ApiCall<DeleteRouteRequest, Operation> _callDelete;

        private readonly gaxgrpc::ApiCall<GetRouteRequest, Route> _callGet;

        private readonly gaxgrpc::ApiCall<InsertRouteRequest, Operation> _callInsert;

        private readonly gaxgrpc::ApiCall<ListRoutesRequest, RouteList> _callList;

        ///
        /// Constructs a client wrapper for the Routes service, with the specified gRPC client and settings.
        ///
        /// <param name="grpcClient">The underlying gRPC client.</param>
        /// <param name="settings">The base <see cref="RoutesSettings"/> used within this client.</param>
        public RoutesClientImpl(Routes.RoutesClient grpcClient, RoutesSettings settings)
        {
            GrpcClient = grpcClient;
            RoutesSettings effectiveSettings = settings ?? RoutesSettings.GetDefault();
            gaxgrpc::ClientHelper clientHelper = new gaxgrpc::ClientHelper(effectiveSettings);
            DeleteOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.DeleteOperationsSettings);
            InsertOperationsClient = new lro::OperationsClientImpl(grpcClient.CreateOperationsClientForGlobalOperations(), effectiveSettings.InsertOperationsSettings);
            _callDelete = clientHelper.BuildApiCall<DeleteRouteRequest, Operation>(grpcClient.DeleteAsync, grpcClient.Delete, effectiveSettings.DeleteSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("route", request => request.Route);
            Modify_ApiCall(ref _callDelete);
            Modify_DeleteApiCall(ref _callDelete);
            _callGet = clientHelper.BuildApiCall<GetRouteRequest, Route>(grpcClient.GetAsync, grpcClient.Get, effectiveSettings.GetSettings).WithGoogleRequestParam("project", request => request.Project).WithGoogleRequestParam("route", request => request.Route);
            Modify_ApiCall(ref _callGet);
            Modify_GetApiCall(ref _callGet);
            _callInsert = clientHelper.BuildApiCall<InsertRouteRequest, Operation>(grpcClient.InsertAsync, grpcClient.Insert, effectiveSettings.InsertSettings).WithGoogleRequestParam("project", request => request.Project);
            Modify_ApiCall(ref _callInsert);
            Modify_InsertApiCall(ref _callInsert);
            _callList = clientHelper.BuildApiCall<ListRoutesRequest, RouteList>(grpcClient.ListAsync, grpcClient.List, effectiveSettings.ListSettings).WithGoogleRequestParam("project", request => request.Project);
            Modify_ApiCall(ref _callList);
            Modify_ListApiCall(ref _callList);
            OnConstruction(grpcClient, effectiveSettings, clientHelper);
        }

        partial void Modify_ApiCall<TRequest, TResponse>(ref gaxgrpc::ApiCall<TRequest, TResponse> call) where TRequest : class, proto::IMessage<TRequest> where TResponse : class, proto::IMessage<TResponse>;

        partial void Modify_DeleteApiCall(ref gaxgrpc::ApiCall<DeleteRouteRequest, Operation> call);

        partial void Modify_GetApiCall(ref gaxgrpc::ApiCall<GetRouteRequest, Route> call);

        partial void Modify_InsertApiCall(ref gaxgrpc::ApiCall<InsertRouteRequest, Operation> call);

        partial void Modify_ListApiCall(ref gaxgrpc::ApiCall<ListRoutesRequest, RouteList> call);

        partial void OnConstruction(Routes.RoutesClient grpcClient, RoutesSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);

        /// The underlying gRPC Routes client
        public override Routes.RoutesClient GrpcClient { get; }

        partial void Modify_DeleteRouteRequest(ref DeleteRouteRequest request, ref gaxgrpc::CallSettings settings);

        partial void Modify_GetRouteRequest(ref GetRouteRequest request, ref gaxgrpc::CallSettings settings);

        partial void Modify_InsertRouteRequest(ref InsertRouteRequest request, ref gaxgrpc::CallSettings settings);

        partial void Modify_ListRoutesRequest(ref ListRoutesRequest request, ref gaxgrpc::CallSettings settings);

        /// The long-running operations client for <c>Delete</c>.
        public override lro::OperationsClient DeleteOperationsClient { get; }

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public override lro::Operation<Operation, Operation> Delete(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_DeleteRouteRequest(ref request, ref callSettings);
            Operation response = _callDelete.Sync(request, callSettings);
            GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response);
            request.PopulatePollRequestFields(pollRequest);
            return new lro::Operation<Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient);
        }

        ///
        /// Deletes the specified Route resource.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public override async stt::Task<lro::Operation<Operation, Operation>> DeleteAsync(DeleteRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_DeleteRouteRequest(ref request, ref callSettings);
            Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false);
            GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response);
            request.PopulatePollRequestFields(pollRequest);
            return new lro::Operation<Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient);
        }

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public override Route Get(GetRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_GetRouteRequest(ref request, ref callSettings);
            return _callGet.Sync(request, callSettings);
        }

        ///
        /// Returns the specified Route resource. Gets a list of available routes by making a list() request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public override stt::Task<Route> GetAsync(GetRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_GetRouteRequest(ref request, ref callSettings);
            return _callGet.Async(request, callSettings);
        }

        /// The long-running operations client for <c>Insert</c>.
        public override lro::OperationsClient InsertOperationsClient { get; }

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>The RPC response.</returns>
        public override lro::Operation<Operation, Operation> Insert(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_InsertRouteRequest(ref request, ref callSettings);
            Operation response = _callInsert.Sync(request, callSettings);
            GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response);
            request.PopulatePollRequestFields(pollRequest);
            return new lro::Operation<Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient);
        }

        ///
        /// Creates a Route resource in the specified project using the data included in the request.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A Task containing the RPC response.</returns>
        public override async stt::Task<lro::Operation<Operation, Operation>> InsertAsync(InsertRouteRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_InsertRouteRequest(ref request, ref callSettings);
            Operation response = await _callInsert.Async(request, callSettings).ConfigureAwait(false);
            GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response);
            request.PopulatePollRequestFields(pollRequest);
            return new lro::Operation<Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), InsertOperationsClient);
        }

        ///
        /// Retrieves the list of Route resources available to the specified project.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable sequence of <see cref="Route"/> resources.</returns>
        public override gax::PagedEnumerable<RouteList, Route> List(ListRoutesRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_ListRoutesRequest(ref request, ref callSettings);
            return new gaxgrpc::GrpcPagedEnumerable<ListRoutesRequest, RouteList, Route>(_callList, request, callSettings);
        }

        ///
        /// Retrieves the list of Route resources available to the specified project.
        ///
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable asynchronous sequence of <see cref="Route"/> resources.</returns>
        public override gax::PagedAsyncEnumerable<RouteList, Route> ListAsync(ListRoutesRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_ListRoutesRequest(ref request, ref callSettings);
            return new gaxgrpc::GrpcPagedAsyncEnumerable<ListRoutesRequest, RouteList, Route>(_callList, request, callSettings);
        }
    }

    public partial class ListRoutesRequest : gaxgrpc::IPageRequest
    {
        /// <inheritdoc/>
        public int PageSize
        {
            get => checked((int)MaxResults);
            set => MaxResults = checked((uint)value);
        }
    }

    public partial class RouteList : gaxgrpc::IPageResponse<Route>
    {
        /// Returns an enumerator that iterates through the resources in this response.
        public scg::IEnumerator<Route> GetEnumerator() => Items.GetEnumerator();

        sc::IEnumerator sc::IEnumerable.GetEnumerator() => GetEnumerator();
    }

    public static partial class Routes
    {
        public partial class RoutesClient
        {
            ///
            /// Creates a new instance of <see cref="lro::Operations.OperationsClient"/> using the same call invoker as
            /// this client, delegating to GlobalOperations.
            ///
            /// <returns>A new Operations client for the same target as this client.</returns>
            public virtual lro::Operations.OperationsClient CreateOperationsClientForGlobalOperations() =>
                GlobalOperations.GlobalOperationsClient.CreateOperationsClient(CallInvoker);
        }
    }
}


text:
var http = require('http');

var server = http.createServer(function(request, response) {

var urlreq = request.url
var urlmsg = urlreq.replace(/\//,"")

	if(!!urlmsg){
        var basemsg = "Hello ";
   		var message = basemsg.concat(urlmsg);
  	} else {
		var message = "Hello World in node.js";
  	}

    response.writeHead(200, {"Content-Type": "text/plain"});
    response.end(message);

});

var port = process.env.PORT || 1337;
server.listen(port);

console.log("Server running at http://localhost:%d", port);

redpajama_set_name: RedPajamaGithub


text:
import {
  ArraySchema,
  ChoiceSchema,
  ConstantSchema,
  DictionarySchema,
  Schema,
  SchemaResponse,
  SchemaType,
  SealedChoiceSchema,
  Response,
} from "@autorest/codemodel";

export function isConstantSchema(schema: Schema): schema is ConstantSchema {
  return schema.type === SchemaType.Constant;
}

export function isArraySchema(schema: Schema): schema is ArraySchema {
  return schema.type === SchemaType.Array;
}

export function isChoiceSchema(schema: Schema): schema is ChoiceSchema {
  return schema.type === SchemaType.Choice;
}

export function isSealedChoiceSchema(schema: Schema): schema is SealedChoiceSchema {
  return schema.type === SchemaType.SealedChoice;
}

export function isDictionarySchema(schema: Schema): schema is DictionarySchema {
  return schema.type === SchemaType.Dictionary;
}

export function isResponseSchema(response: Response | SchemaResponse): response is SchemaResponse {
  return (response as SchemaResponse).schema !== undefined;
}


text:
* Just 2KB
* Easy to get started, only two interface(bind and copy)
* High performance, copy speed: 3000KB/s

---

## Getting started
---
### Step 1:Install
```javascript
npm install superClipBoard --save
```
You can also download the [file](https://raw.githubusercontent.com/milan-hwj/SuperClipBoard/master/dist/superClipBoard.min.js) directly.

### Step 2:Import js file
```javascript
<script type="text/javascript" src="../dist/superClipBoard.min.js"></script>
```

### Step 3: Bind
```javascript
<button id="btn" data-copy-content="Hello">copy 'Hello'</button>
<script>
    // fast bind
    superClipBoard.bind(document.getElementById('btn'));
</script>
```

## Usage
---
### Bind copy event
Set a 'data-copy-content' attribute in your trigger element
```javascript
<div class="example1" data-copy-content="Hello World">copy</div>
```
then you can using a variety of selector to bind copy event.
```javascript
// example1: document selector
superClipBoard.bind(document.getElementsByClassName('example1'));

// example2: selector like jquery
superClipBoard.bind('.example2');

// example3: jquery nodes (import jquery)
superClipBoard.bind($('.example3'));

// example4: simple dom array
superClipBoard.bind([
    document.getElementById('example4_1'),
    document.getElementById('example4_2')
]);
```
### DIY copy event
```javascript
// You can use any event such as click, mouseover, mouseover etc.. to bind copy behavior
// IE browser using 'attachEvent' binding event
document.getElementById('btn1').addEventListener("click", function(){
        // use 'copy(content)' to set the copy content
        // The copy function return result: boolean(ture or false)
        superClipBoard.copy('Hello');
});
```
### Copy feedback
Both 'copy' and 'bind' are provide feedback.
```javascript
// copy feedback
var option = {
    success: function(){
        alert('copy success');
    },
    // If clipboad is not big enough to storage text, it will run this function
    // The max size of clipboad depend on your runing envrionment
    error: function(){
        alert('copy error');
    }
}
// bind Event
document.getElementById('btn1').addEventListener("click", function(){
        superClipBoard.copy('Hello', option);
});
// fast bind
superClipBoard.bind(document.getElementById('btn2'), option);
```

# License
[MIT License](https://raw.githubusercontent.com/milan-hwj/SuperClipBoard/master/LICENSE)


text:
name             'windows_security_policy'
maintainer       'ChrisA.Walker'
maintainer_email 'chrisa.walker@target.com'
license          'All rights reserved'
description      'Installs/Configures Windows Security Options'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          '0.0.6'

# depends 'windows', '>= 1.37.2'


text:
from ooiui.core.app import app
from flask import request, render_template, Response, jsonify, session
from werkzeug.exceptions import Unauthorized
import requests
import json
import urllib
from uuid import uuid4

def get_login():
    token = request.cookies.get('ooiusertoken')
    if not token:
        return None
    token = urllib.unquote(token).decode('utf8')
    return token

def generate_csrf_token():
    if '_csrf_token' not in session:
        session['_csrf_token'] = uuid4().hex
    return session['_csrf_token']

app.jinja_env.globals['csrf_token'] = generate_csrf_token

@app.route('/signup')
def user_signup():
    return render_template('common/signup.html')

@app.route('/user/edit/<int:id>')
def user_edit(id):
    return render_template('common/userEdit.html')

@app.route('/users/')
def users():
    return render_template('common/users.html')

@app.route('/troubleTicket')
def create_ticket():
    return render_template('common/troubleTicket.html')

@app.route('/login')
def user_login():
    return render_template('common/loginDemo.html')

@app.route('/pioneerarray')
def pioneer_array():
    return render_template('common/pioneerArray.html')

@app.route('/infrastructure')
def infrastructure():
    return render_template('common/infrastructure.html')

@app.route('/NewEvent')
def new_event():
    return render_template('common/newEvent.html')

@app.route('/basic.html')
def basic():
    return render_template('common/basic.html')

@app.route('/svgplot.html')
def svg_timeseries_plot():
    return render_template('common/svgplot.html')

@app.route('/depthplot.html')
def svg_depthprofile_plot():
    return render_template('common/depthplot.html')

@app.route('/chartDemo.html')
def chart_demo():
    return render_template('common/chartDemo.html')

@app.route('/plotsDemo.html')
def plots_demo():
    return render_template('common/plotsDemo.html')

@app.route('/api/organization', methods=['GET'])
def get_organization():
    response = requests.get(app.config['SERVICES_URL'] + '/organization', params=request.args)
    return response.text, response.status_code

@app.route('/api/organization/<int:id>', methods=['GET'])
def get_organization_by_id(id):
    response = requests.get(app.config['SERVICES_URL'] + '/organization/%s' % id, params=request.args)
    return response.text, response.status_code

@app.route('/api/user', methods=['GET'])
def get_users():
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/user', auth=(token, ''))
    return response.text, response.status_code

@app.route('/api/current_user', methods=['GET'])
def get_current_user():
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/current_user', auth=(token, ''))
    return response.text, response.status_code

@app.route('/api/user/<int:id>', methods=['GET'])
def get_user_by_id(id):
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/user/%s' % id, auth=(token, ''))
    return response.text, response.status_code

@app.route('/api/user/<int:id>', methods=['PUT'])
def put_user(id):
    token = get_login()
    response = requests.put(app.config['SERVICES_URL'] + '/user/%s' % id, auth=(token, ''), data=request.data)
    return response.text, response.status_code

@app.route('/api/user', methods=['POST'])
@app.route('/api/user/', methods=['POST'])
def submit_user():
    '''
    Acts as a pass-thru proxy to to the services
    '''
    csrf_token = session.pop('_csrf_token', None)
    data = json.loads(request.data)
    if not csrf_token or csrf_token != data['_csrf_token']:
        return jsonify(error="CSRF Error"), 401
    api_key = app.config['UI_API_KEY']
    response = requests.post(app.config['SERVICES_URL'] + '/user', headers={'X-Csrf-Token' : api_key}, data=request.data)
    return response.text, response.status_code

@app.route('/api/user_scope', methods=['GET'])
def get_user_scopes():
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/user_scopes', auth=(token, ''))
    return response.text, response.status_code

@app.route('/user_roles')
def user_roles():
    resp = requests.get(app.config['SERVICES_URL'] + '/user_roles')
    return resp.text, resp.status_code

@app.route('/api/ticket', methods=['GET'])
def get_ticket():
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/redmine/ticket', auth=(token, ''))
    return response.text, response.status_code

@app.route('/api/ticket', methods=['POST'])
def submit_ticket():
    '''
    Acts as a pass-thru proxy to to the services
    '''
    token = get_login()
    response = requests.post(app.config['SERVICES_URL'] + '/redmine/ticket', auth=(token, ''), data=request.data)
    return response.text, response.status_code

@app.route('/api/ticket/users', methods=['GET'])
def get_ticket_users():
    '''
    Acts as a pass-thru proxy to to the services to get users
    '''
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/redmine/users', auth=(token, ''), params=request.args)
    return response.text, response.status_code

@app.route('/ticket_roles')
def ticket_roles():
    token = get_login()
    resp = requests.get(app.config['SERVICES_URL'] + '/ticket_roles', auth=(token,''))
    return resp.text, resp.status_code

@app.route('/api/login', methods=['POST'])
def login():
    local_context = json.loads(request.data)
    username = local_context['login']
    password = local_context['password']
    response = requests.get(app.config['SERVICES_URL'] + '/token', auth=(username, password))
    return response.text, response.status_code

@app.route('/api/watch', methods=['GET'])
def get_watch():
    response = requests.get(app.config['SERVICES_URL'] + '/watch', params=request.args)
    return response.text, response.status_code

@app.route('/api/watch', methods=['POST'])
def post_watch():
    token = get_login()
    response = requests.post(app.config['SERVICES_URL'] + '/watch', auth=(token, ''), data=request.data)
    return response.text, response.status_code

@app.route('/api/watch/user', methods=['GET'])
def get_watch_user():
    token = get_login()
    response = requests.get(app.config['SERVICES_URL'] + '/watch/user/', auth=(token, ''), params=request.args)
    return response.text, response.status_code

@app.route('/api/watch/<int:id>', methods=['GET'])
def get_watch_by_id(id):
    response = requests.get(app.config['SERVICES_URL'] + '/watch/%s' % id)
    return response.text, response.status_code

@app.route('/api/watch/<int:id>', methods=['PUT'])
def put_watch(id):
    token = get_login()
    response = requests.put(app.config['SERVICES_URL'] + '/watch/%s' % id, auth=(token, ''), data=request.data)
    return response.text, response.status_code

@app.route('/api/watch/open', methods=['GET'])
def get_watch_open():
    token = get_login()
    resp = requests.get(app.config['SERVICES_URL'] + '/watch/open', auth=(token,''), params=request.args)
    return resp.text, resp.status_code

@app.route('/api/operator_event', methods=['GET'])
def get_operator_event():
    response = requests.get(app.config['SERVICES_URL'] + '/operator_event', params=request.args)
    return response.text, response.status_code

@app.route('/api/operator_event', methods=['POST'])
def post_event():
    token = get_login()
    response = requests.post(app.config['SERVICES_URL'] + '/operator_event', auth=(token, ''), data=request.data)
    return response.text, response.status_code

@app.route('/api/operator_event_type', methods=['GET'])
def get_operator_event_type():
    response = requests.get(app.config['SERVICES_URL'] + '/operator_event_type', params=request.args)
    return response.text, response.status_code


text:
.class public Landroid/app/AlertDialog;
.super Landroid/app/Dialog;
.source "AlertDialog.java"

# interfaces
.implements Landroid/content/DialogInterface;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/app/AlertDialog$Builder;
    }
.end annotation

# static fields
.field public static final THEME_DEVICE_DEFAULT_DARK:I = 0x4

.field public static final THEME_DEVICE_DEFAULT_LIGHT:I = 0x5

.field public static final THEME_HOLO_DARK:I = 0x2

.field public static final THEME_HOLO_LIGHT:I = 0x3

.field public static final THEME_TRADITIONAL:I = 0x1

# instance fields
.field private mAlert:Lcom/android/internal/app/AlertController;

# direct methods
.method protected constructor <init>(Landroid/content/Context;)V
    .locals 2
    .parameter "context"

    .prologue
    .line 98
    const/4 v0, 0x0

    invoke-static {p1, v0}, Landroid/app/AlertDialog;->resolveDialogTheme(Landroid/content/Context;I)I

    move-result v0

    const/4 v1, 0x1

    invoke-direct {p0, p1, v0, v1}, Landroid/app/AlertDialog;-><init>(Landroid/content/Context;IZ)V

    .line 99
    return-void
.end method

.method protected constructor <init>(Landroid/content/Context;I)V
    .locals 1
    .parameter "context"
    .parameter "theme"

    .prologue
    .line 110
    const/4 v0, 0x1

    invoke-direct {p0, p1, p2, v0}, Landroid/app/AlertDialog;-><init>(Landroid/content/Context;IZ)V

    .line 111
    return-void
.end method

.method constructor <init>(Landroid/content/Context;IZ)V
    .locals 3
    .parameter "context"
    .parameter "theme"
    .parameter "createContextWrapper"

    .prologue
    .line 114
    invoke-static {p1, p2}, Landroid/app/AlertDialog;->resolveDialogTheme(Landroid/content/Context;I)I

    move-result v0

    invoke-direct {p0, p1, v0, p3}, Landroid/app/Dialog;-><init>(Landroid/content/Context;IZ)V

    .line 115
    iget-object v0, p0, Landroid/app/Dialog;->mWindow:Landroid/view/Window;

    invoke-virtual {v0}, Landroid/view/Window;->alwaysReadCloseOnTouchAttr()V

    .line 116
    new-instance v0, Lcom/android/internal/app/AlertController;

    invoke-virtual {p0}, Landroid/app/Dialog;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {p0}, Landroid/app/Dialog;->getWindow()Landroid/view/Window;

    move-result-object v2

    invoke-direct {v0, v1, p0, v2}, Lcom/android/internal/app/AlertController;-><init>(Landroid/content/Context;Landroid/content/DialogInterface;Landroid/view/Window;)V

    iput-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    .line 117
    return-void
.end method

.method protected constructor <init>(Landroid/content/Context;ZLandroid/content/DialogInterface$OnCancelListener;)V
    .locals 2
    .parameter "context"
    .parameter "cancelable"
    .parameter "cancelListener"

    .prologue
    .line 120
    const/4 v0, 0x0

    invoke-static {p1, v0}, Landroid/app/AlertDialog;->resolveDialogTheme(Landroid/content/Context;I)I

    move-result v0

    invoke-direct {p0, p1, v0}, Landroid/app/Dialog;-><init>(Landroid/content/Context;I)V

    .line 121
    iget-object v0, p0, Landroid/app/Dialog;->mWindow:Landroid/view/Window;

    invoke-virtual {v0}, Landroid/view/Window;->alwaysReadCloseOnTouchAttr()V

    .line 122
    invoke-virtual {p0, p2}, Landroid/app/Dialog;->setCancelable(Z)V

    .line 123
    invoke-virtual {p0, p3}, Landroid/app/Dialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V

    .line 124
    new-instance v0, Lcom/android/internal/app/AlertController;

    invoke-virtual {p0}, Landroid/app/Dialog;->getWindow()Landroid/view/Window;

    move-result-object v1

    invoke-direct {v0, p1, p0, v1}, Lcom/android/internal/app/AlertController;-><init>(Landroid/content/Context;Landroid/content/DialogInterface;Landroid/view/Window;)V

    iput-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    .line 125
    return-void
.end method

.method static synthetic access$000(Landroid/app/AlertDialog;)Lcom/android/internal/app/AlertController;
    .locals 1
    .parameter "x0"

    .prologue
    .line 64
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    return-object v0
.end method

.method static resolveDialogTheme(Landroid/content/Context;I)I
    .locals 4
    .parameter "context"
    .parameter "resid"

    .prologue
    const/4 v3, 0x1

    .line 128
    if-ne p1, v3, :cond_1

    .line 129
    const p1, 0x10302e9

    .line 144
    .end local p1
    :cond_0
    :goto_0
    return p1

    .line 130
    .restart local p1
    :cond_1
    const/4 v1, 0x2

    if-ne p1, v1, :cond_2

    .line 131
    const p1, 0x10302f9

    goto :goto_0

    .line 132
    :cond_2
    const/4 v1, 0x3

    if-ne p1, v1, :cond_3

    .line 133
    const p1, 0x10302fc

    goto :goto_0

    .line 134
    :cond_3
    const/4 v1, 0x4

    if-ne p1, v1, :cond_4

    .line 135
    const p1, 0x1030301

    goto :goto_0

    .line 136
    :cond_4
    const/4 v1, 0x5

    if-ne p1, v1, :cond_5

    .line 137
    const p1, 0x1030302

    goto :goto_0

    .line 138
    :cond_5
    const/high16 v1, 0x100

    if-ge p1, v1, :cond_0

    .line 141
    new-instance v0, Landroid/util/TypedValue;

    invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V

    .line 142
    .local v0, outValue:Landroid/util/TypedValue;
    invoke-virtual {p0}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;

    move-result-object v1

    const v2, 0x1010309

    invoke-virtual {v1, v2, v0, v3}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z

    .line 144
    iget p1, v0, Landroid/util/TypedValue;->resourceId:I

    goto :goto_0
.end method

# virtual methods
.method public getButton(I)Landroid/widget/Button;
    .locals 1
    .parameter "whichButton"

    .prologue
    .line 159
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->getButton(I)Landroid/widget/Button;

    move-result-object v0

    return-object v0
.end method

.method public getListView()Landroid/widget/ListView;
    .locals 1

    .prologue
    .line 168
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0}, Lcom/android/internal/app/AlertController;->getListView()Landroid/widget/ListView;

    move-result-object v0

    return-object v0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 1
    .parameter "savedInstanceState"

    .prologue
    .line 335
    invoke-super {p0, p1}, Landroid/app/Dialog;->onCreate(Landroid/os/Bundle;)V

    .line 336
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0}, Lcom/android/internal/app/AlertController;->installContent()V

    .line 337
    return-void
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 1
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 341
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1, p2}, Lcom/android/internal/app/AlertController;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    .line 342
    :goto_0
    return v0

    :cond_0
    invoke-super {p0, p1, p2}, Landroid/app/Dialog;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    goto :goto_0
.end method

.method public onKeyUp(ILandroid/view/KeyEvent;)Z
    .locals 1
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 347
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1, p2}, Lcom/android/internal/app/AlertController;->onKeyUp(ILandroid/view/KeyEvent;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    .line 348
    :goto_0
    return v0

    :cond_0
    invoke-super {p0, p1, p2}, Landroid/app/Dialog;->onKeyUp(ILandroid/view/KeyEvent;)Z

    move-result v0

    goto :goto_0
.end method

.method public setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V
    .locals 2
    .parameter "whichButton"
    .parameter "text"
    .parameter "listener"

    .prologue
    .line 235
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    const/4 v1, 0x0

    invoke-virtual {v0, p1, p2, p3, v1}, Lcom/android/internal/app/AlertController;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;Landroid/os/Message;)V

    .line 236
    return-void
.end method

.method public setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V
    .locals 2
    .parameter "whichButton"
    .parameter "text"
    .parameter "msg"

    .prologue
    .line 221
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    const/4 v1, 0x0

    invoke-virtual {v0, p1, p2, v1, p3}, Lcom/android/internal/app/AlertController;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;Landroid/os/Message;)V

    .line 222
    return-void
.end method

.method public setButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V
    .locals 1
    .parameter "text"
    .parameter "listener"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 276
    const/4 v0, -0x1

    invoke-virtual {p0, v0, p1, p2}, Landroid/app/AlertDialog;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V

    .line 277
    return-void
.end method

.method public setButton(Ljava/lang/CharSequence;Landroid/os/Message;)V
    .locals 1
    .parameter "text"
    .parameter "msg"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 244
    const/4 v0, -0x1

    invoke-virtual {p0, v0, p1, p2}, Landroid/app/AlertDialog;->setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V

    .line 245
    return-void
.end method

.method public setButton2(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V
    .locals 1
    .parameter "text"
    .parameter "listener"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 289
    const/4 v0, -0x2

    invoke-virtual {p0, v0, p1, p2}, Landroid/app/AlertDialog;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V

    .line 290
    return-void
.end method

.method public setButton2(Ljava/lang/CharSequence;Landroid/os/Message;)V
    .locals 1
    .parameter "text"
    .parameter "msg"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 253
    const/4 v0, -0x2

    invoke-virtual {p0, v0, p1, p2}, Landroid/app/AlertDialog;->setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V

    .line 254
    return-void
.end method

.method public setButton3(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V
    .locals 1
    .parameter "text"
    .parameter "listener"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 302
    const/4 v0, -0x3

    invoke-virtual {p0, v0, p1, p2}, Landroid/app/AlertDialog;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V

    .line 303
    return-void
.end method

.method public setButton3(Ljava/lang/CharSequence;Landroid/os/Message;)V
    .locals 1
    .parameter "text"
    .parameter "msg"
    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 262
    const/4 v0, -0x3

    invoke-virtual {p0, v0, p1, p2}, Landroid/app/AlertDialog;->setButton(ILjava/lang/CharSequence;Landroid/os/Message;)V

    .line 263
    return-void
.end method

.method public setCustomTitle(Landroid/view/View;)V
    .locals 1
    .parameter "customTitleView"

    .prologue
    .line 181
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setCustomTitle(Landroid/view/View;)V

    .line 182
    return-void
.end method

.method public setIcon(I)V
    .locals 1
    .parameter "resId"

    .prologue
    .line 311
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setIcon(I)V

    .line 312
    return-void
.end method

.method public setIcon(Landroid/graphics/drawable/Drawable;)V
    .locals 1
    .parameter "icon"

    .prologue
    .line 315
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 316
    return-void
.end method

.method public setIconAttribute(I)V
    .locals 3
    .parameter "attrId"

    .prologue
    .line 324
    new-instance v0, Landroid/util/TypedValue;

    invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V

    .line 325
    .local v0, out:Landroid/util/TypedValue;
    iget-object v1, p0, Landroid/app/Dialog;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;

    move-result-object v1

    const/4 v2, 0x1

    invoke-virtual {v1, p1, v0, v2}, Landroid/content/res/Resources$Theme;->resolveAttribute(ILandroid/util/TypedValue;Z)Z

    .line 326
    iget-object v1, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    iget v2, v0, Landroid/util/TypedValue;->resourceId:I

    invoke-virtual {v1, v2}, Lcom/android/internal/app/AlertController;->setIcon(I)V

    .line 327
    return-void
.end method

.method public setInverseBackgroundForced(Z)V
    .locals 1
    .parameter "forceInverseBackground"

    .prologue
    .line 330
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setInverseBackgroundForced(Z)V

    .line 331
    return-void
.end method

.method public setMessage(Ljava/lang/CharSequence;)V
    .locals 1
    .parameter "message"

    .prologue
    .line 185
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setMessage(Ljava/lang/CharSequence;)V

    .line 186
    return-void
.end method

.method public setTitle(Ljava/lang/CharSequence;)V
    .locals 1
    .parameter "title"

    .prologue
    .line 173
    invoke-super {p0, p1}, Landroid/app/Dialog;->setTitle(Ljava/lang/CharSequence;)V

    .line 174
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setTitle(Ljava/lang/CharSequence;)V

    .line 175
    return-void
.end method

.method public setView(Landroid/view/View;)V
    .locals 1
    .parameter "view"

    .prologue
    .line 192
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    invoke-virtual {v0, p1}, Lcom/android/internal/app/AlertController;->setView(Landroid/view/View;)V

    .line 193
    return-void
.end method

.method public setView(Landroid/view/View;IIII)V
    .locals 6
    .parameter "view"
    .parameter "viewSpacingLeft"
    .parameter "viewSpacingTop"
    .parameter "viewSpacingRight"
    .parameter "viewSpacingBottom"

    .prologue
    .line 207
    iget-object v0, p0, Landroid/app/AlertDialog;->mAlert:Lcom/android/internal/app/AlertController;

    move-object v1, p1

    move v2, p2

    move v3, p3

    move v4, p4

    move v5, p5

    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/app/AlertController;->setView(Landroid/view/View;IIII)V

    .line 208
    return-void
.end method


text:
package guitests;

import static org.junit.Assert.assertTrue;
import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_DIRECTORY;
import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_FILE;

import java.io.File;
import java.io.IOException;

import org.junit.After;
import org.junit.Test;

import seedu.tache.commons.core.Config;
import seedu.tache.commons.core.Messages;
import seedu.tache.commons.util.ConfigUtil;
import seedu.tache.logic.commands.LoadCommand;
import seedu.tache.logic.commands.SaveCommand;
import seedu.tache.logic.commands.UndoCommand;
import seedu.tache.testutil.TestTask;
import seedu.tache.testutil.TestUtil;

public class SaveAndLoadCommandTest extends TaskManagerGuiTest {

    public final String saveFolder1 = TestUtil.SANDBOX_FOLDER + "saveTest1";
    public final String saveFolder2 = TestUtil.SANDBOX_FOLDER + "saveTest2";
    public final String fileName = "\\taskmanager.xml";

    @Test
    public void saveAndLoadDataFile() {
        TestTask[] tasks = td.getTypicalTasks();

        commandBox.runCommand(td.getFit.getAddCommand());
        tasks = TestUtil.addTasksToList(tasks, td.getFit);

        commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + saveFolder1);
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + saveFolder2);

        //Delete the newly added task and add findGirlfriend
        commandBox.runCommand("delete 3"); //delete getFit
        tasks = TestUtil.removeTasksFromList(tasks, td.getFit);
        commandBox.runCommand(td.findGirlfriend.getAddCommand());
        tasks = TestUtil.addTasksToList(tasks, td.findGirlfriend);
        assertTrue(taskListPanel.isListMatching(tasks));

        //Load saveTest1
        //saveTest1 : payDavid, visitSarah, eggsAndBread, visitGrandma, readBook, getFit
        //saveTest2 : payDavid, visitSarah, eggsAndBread, visitGrandma, readBook, findGirlfriend
        commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + saveFolder1 + fileName);
        tasks = TestUtil.removeTasksFromList(tasks, td.findGirlfriend);

        //Check if saveTest1 still has getFit
        tasks = TestUtil.addTasksToList(td.getTypicalTasks(), td.getFit);
        assertTrue(taskListPanel.isListMatching(tasks));

        tasks = TestUtil.removeTasksFromList(tasks, td.getFit);
        tasks = TestUtil.removeTasksFromList(tasks, td.visitSarah);
        commandBox.runCommand("delete 3"); //getFit
        commandBox.runCommand("delete 2"); //visitSarah
        commandBox.runCommand(td.findGirlfriend.getAddCommand());
        tasks = TestUtil.addTasksToList(tasks, td.findGirlfriend);
        assertTrue(taskListPanel.isListMatching(tasks));
        //saveTest1 : payDavid, eggsAndBread, visitGrandma, readBook, findGirlfriend
        //saveTest2 : payDavid, visitSarah, eggsAndBread, visitGrandma, readBook, findGirlfriend)

        //Load back the new file and check if getFit is deleted
        tasks = TestUtil.addTasksToList(td.getTypicalTasks(), td.findGirlfriend);
        commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + saveFolder2 + fileName);
        assertTrue(taskListPanel.isListMatching(tasks));
    }

    @Test
    public void save_invalidDirectory_failure() {
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " \\");
        assertResultMessage(MESSAGE_INVALID_DIRECTORY);
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " /");
        assertResultMessage(MESSAGE_INVALID_DIRECTORY);
    }

    @Test
    public void save_directoryNotExist_success() {
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + saveFolder1 + "\\NotExistFolder");
        assertResultMessage(String.format(SaveCommand.MESSAGE_SUCCESS, saveFolder1 + "\\NotExistFolder"));
    }

    @Test
    public void save_directoryExist_success() {
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + saveFolder1);
        assertResultMessage(String.format(SaveCommand.MESSAGE_SUCCESS, saveFolder1));
    }

    @Test
    public void load_invalidFilePath_failure() {
        commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + saveFolder1);
        assertResultMessage(MESSAGE_INVALID_FILE);
        commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + saveFolder1 + "\\someInvalidFolder" + fileName);
        assertResultMessage(MESSAGE_INVALID_FILE);
    }

    @Test
    public void save_invalidCommand_failure() {
        commandBox.runCommand("saveeeeeee");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    @Test
    public void load_invalidCommand_failure() {
        commandBox.runCommand("loaddddd");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    @Test
    public void save_undo_success() {
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + saveFolder1);
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + saveFolder2);
        commandBox.runCommand(UndoCommand.COMMAND_WORD);
        assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS,
                            String.format(SaveCommand.MESSAGE_SUCCESS, saveFolder1)));
    }

    @Test
    public void load_undo_success() {
        commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + saveFolder1 + fileName);
        commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + saveFolder2 + fileName);
        commandBox.runCommand(UndoCommand.COMMAND_WORD);
        assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS,
                            String.format(LoadCommand.MESSAGE_SUCCESS, saveFolder1 + fileName)));
    }

    //@@author A0142255M
    public void save_noDirectoryGiven_failure() {
        commandBox.runCommand(SaveCommand.COMMAND_WORD + " ");
        assertResultMessage("");
    }

    //@@author A0139961U
    @After
    public void cleanUp() {
        //Revert the config.json back to original
        try {
            ConfigUtil.saveConfig(new Config(), "config.json");
        } catch (IOException e) {
            e.printStackTrace();
        }

        //Delete files
        File file = new File(saveFolder1);
        file.delete();
        file = new File(saveFolder2);
        file.delete();
    }

}


text:
PlayMorphia Play 2.8.x Module
=====================================

This is a Play 2.8.x Module for [Morphia](https://github.com/MorphiaOrg/morphia)
(a MongoDB Java driver wrapper).

Installation
-----------

Add the following to your build.sbt:

    libraryDependencies ++= Seq(
        guice,
        "org.mongodb" % "mongo-java-driver" % "3.12.0",
        "dev.morphia.morphia" % "core" % "1.5.8",
        )

Create a `lib` folder in your project directory and copy play-morphia.jar inside.

You will need to specify your MongoDB configuration in the `conf/application.conf`file:

    playmorphia {
        uri="mongodb://127.0.0.1:27017/"
        database="YourDB"
        models="models"
        mongoClientFactory="controllers.mongoConfiguration.MyMongoClientFactory"
    }

#### MongoClient Factory

Not all MongoClient options are supported by the MongoClientURI.  For full customization of the generated MongoClient, you can specify your own MongoClientFactory class in the `playmorphia` section of the `conf/application.conf`, like this:

    mongoClientFactory="controllers.mongoConfiguration.MyMongoClientFactory"

(I created a package inside `controllers` named `mongoConfiguration`)

The value should be the name of a class that extends from `it.unifi.cerm.playmorphia.MongoClientFactory` and provide at least an empty constructor or a constructor that takes a play Configuration.  For example:

```java
package controllers.mongoConfiguration;

import com.mongodb.MongoClient;
import com.mongodb.ServerAddress;
import com.typesafe.config.Config;
import it.unifi.cerm.playmorphia.MongoClientFactory;

import java.util.Arrays;

public class MyMongoClientFactory  extends MongoClientFactory {

    private Config config;

    public MyMongoClientFactory(Config config) {
        super(config);
        this.config = config;
    }

    public MongoClient createClient() throws Exception {
         return new MongoClient(Arrays.asList(
                 new ServerAddress("localhost", 27017)
                 )
         );
     }

    public String getDBName() {
        return config.getString("playmorphia.database");
    }

}
```

Usage
-----

**Play Framework 2.8.x**

A way to use PlayMorphia is to create a repositories package containing repository classes, one for each model. A repository class contains all methods to access to the collection members.
The package structure should be similar to the following:
```
|- controllers
|- models
|- repositories
```

Model example:

```java

import org.bson.types.ObjectId;
import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id;

@Entity(value = "DB.users")
public class User  {

    @Id
    private ObjectId _id;
    private String firstname;
    private String lastname;
    private String email;

    public ObjectId getId() {
        return _id;
    }

    public void setId(ObjectId _id) {
        this._id = _id;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
```

Repository example:

```java
package repositories;

import it.unifi.cerm.playmorphia.PlayMorphia;
import models.User;
import org.bson.types.ObjectId;

import javax.inject.Inject;

public class UserRepository {

    private final PlayMorphia morphia;

    @Inject
    public UserRepository(PlayMorphia morphia) {
        this.morphia = morphia;
    }

    public User findById(String id) {
        User user = morphia.
                datastore().
                createQuery(User.class).
                field("_id").
                equal(new ObjectId(id)).
                get();
        return user;
    }

    public void save(User u) {
        morphia.datastore().save(u);
    }
}
```

Controller example:

```java
import views.html.modifyUserView;

public class UserController extends Controller {

    @Inject
    private UserRepository user;

    public Result modifyUser(String id) {
        User u = user.findById(id);
        return ok(modifyUserView.render(u));
    }
}
```

Contact
-------

If you have a question or need some help you can just [open an issue](https://github.com/morellik/play-morphia/issues).

License
-------

The license is Apache 2.0, see LICENSE.txt.


text:
<?php defined('SYSPATH') OR die('No direct script access.');

class Asset_Processor_Jsminplus extends Kohana_Asset_Processor_Jsminplus {}


text:
using System;
using System.Linq;
using Linq2Acad;
using Autodesk.AutoCAD.DatabaseServices;
using AcadTestRunner;

namespace Linq2Acad.Tests
{
  public class TableStyleContainerTests
  {
    [AcadTest]
    public void TestCreateTableStyle()
    {
      var newId = ObjectId.Null;

      using (var db = AcadDatabase.Active())
      {
        var newTableStyle = db.TableStyles.Create("NewTableStyle");
        newId = newTableStyle.ObjectId;
      }

      AcadAssert.That.TableStyleDictionary.Contains("NewTableStyle");
      AcadAssert.That.TableStyleDictionary.Contains(newId);
    }
  }
}


text:
NSUInteger const kJotDrawStepsPerBezier = 300;

@implementation JotTouchBezier

+ (instancetype)withColor:(UIColor *)color
{
    JotTouchBezier *touchBezier = [JotTouchBezier new];

    touchBezier.strokeColor = color;

    return touchBezier;
}

- (void)jotDrawBezier
{
    if (self.constantWidth) {
        UIBezierPath *bezierPath = [UIBezierPath new];
        [bezierPath moveToPoint:self.startPoint];
        [bezierPath addCurveToPoint:self.endPoint controlPoint1:self.controlPoint1 controlPoint2:self.controlPoint2];
        bezierPath.lineWidth = self.startWidth;
        bezierPath.lineCapStyle = kCGLineCapRound;
        [self.strokeColor setStroke];
        [bezierPath strokeWithBlendMode:kCGBlendModeNormal alpha:1.f];
    } else {
        [self.strokeColor setFill];

        CGFloat widthDelta = self.endWidth - self.startWidth;

        for (NSUInteger i = 0; i < kJotDrawStepsPerBezier; i++) {

            CGFloat t = ((CGFloat)i) / (CGFloat)kJotDrawStepsPerBezier;
            CGFloat tt = t * t;
            CGFloat ttt = tt * t;
            CGFloat u = 1.f - t;
            CGFloat uu = u * u;
            CGFloat uuu = uu * u;

            CGFloat x = uuu * self.startPoint.x;
            x += 3 * uu * t * self.controlPoint1.x;
            x += 3 * u * tt * self.controlPoint2.x;
            x += ttt * self.endPoint.x;

            CGFloat y = uuu * self.startPoint.y;
            y += 3 * uu * t * self.controlPoint1.y;
            y += 3 * u * tt * self.controlPoint2.y;
            y += ttt * self.endPoint.y;

            CGFloat pointWidth = self.startWidth + (ttt * widthDelta);
            [self.class jotDrawBezierPoint:CGPointMake(x, y) withWidth:pointWidth];
        }
    }
}

+ (void)jotDrawBezierPoint:(CGPoint)point withWidth:(CGFloat)width
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    if (!context) {
        return;
    }

    CGContextFillEllipseInRect(context, CGRectInset(CGRectMake(point.x, point.y, 0.f, 0.f), -width / 2.f, -width / 2.f));
}

@end


text:
<?php
/*
 * File Name    :head.php
 * Folder Name  :Admin
 * Author       :Imaduddin Haris Nasution|Digital Art Developer
 */
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="<?= $assets;?>images/fav.png" type="image/x-icon">
    <title>e-Government | <?= $title; ?> </title>

    <!-- Bootstrap -->
    <link href="<?= $css.'bootstrap.min.css';?>" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="<?= $assets;?>fontawesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="<?= $css.'nprogress.css';?>" rel="stylesheet">
    <!-- iCheck -->
    <link href="<?= $css.'green.css';?>" rel="stylesheet">
    <!-- bootstrap-progressbar -->
    <link href="<?= $css.'bootstrap-progressbar-3.3.4.min.css';?>" rel="stylesheet">
    <!-- JQVMap -->
    <link href="<?= $css.'jqvmap.min.css';?>" rel="stylesheet"/>
    <style>
        .logo-dashboard
        {
            height:50px;
        }
        .custom-input {
            display:inline-block;
            position:relative;
            min-width:250px;
            height:35px;
            font:normal normal 13px/30px Helmet,FreeSans,Sans-Serif;
            border:1px solid #BBB;
            cursor:text;
            box-shadow: inset 0 0 1px 0 #BBB;
            padding-left:5px;
        }
        .custom-input input {
        /* sembunyikan dengan `opacity:0` */
            opacity:0;
            filter:alpha(opacity=0);
        /* pastikan elemen ini selalu berada di sebelah atas */
            display:block;
            position:absolute;
            top:0;
            right:0;
            margin:0;
            padding:0;
            font-size:100%;
            z-index:4;
            cursor:pointer;

        }

        .custom-input span {
            display:block;
            position:absolute;
            top:0;
            right:0;
            bottom:0;
            left:0;
        }
        .custom-input span button {
            margin:0;
            border-radius:0;
        }

        .custom-input span + span {
            left:auto;
        }

        /* Dora the Explorer */

        .custom-input input::-ms-value {display:none}

        .custom-input input::-ms-browse {
            display:block;
            margin:0;
            padding:0;
            cursor:inherit;
        }
    </style>
    <!-- Custom Theme Style -->
    <link href="<?= $css.'custom.min.css';?>" rel="stylesheet">
  </head>

  <body class="nav-md">


text:
var __result1;
function filestreamsuccess(fs){
  var base64 = fs.readBase64(3);
  __result1 = fs.writeBase64(base64);
}

function onsuccess(files) {
     if (files[0].isFile){
         files[0].openStream(
             "w",
             filestreamsuccess
             , function(e){

             }, "UTF-8"
         );
     }
}

 function onerror(error) {

 }

 tizen.filesystem.resolve(
     'documents',
     function(dir){
       dir.listFiles(onsuccess,onerror);
     }, function(e) {

     }, "rw"
 );

var __expect1 = undefined;


text:
Update an existing record in the database and notify subscribed sockets that it has changed.

```usage
PATCH /:model/:id
```

This updates the record in the model which matches the **id** parameter and responds with the newly updated record as a JSON dictionary.  If a validation error occurred, a JSON response with the invalid attributes and a `400` status code will be returned instead.  If no model instance exists matching the specified **id**, a `404` is returned.

### Parameters

_Attributes to change should be sent in the HTTP body as form-encoded values or JSON._

 Parameter                          | Type                                                    | Details
 ---------------------------------- | ------------------------------------------------------- |:---------------------------------
 model                              | ((string))                                              | The [identity](http://sailsjs.com/documentation/concepts/models-and-orm/model-settings#?identity) of the containing model.

e.g. `'product'` (in `PATCH /product/5`)
 id                                 | ((string))                                              | The primary key value of the record to update.

e.g. `'5'` (in `PATCH /product/5`)
 *                                 | ((json))                                                 | For `PATCH` (RESTful) requests, pass in body parameters with the same name as the attributes defined on your model to set those values on the desired record. For `GET` (shortcut) requests, add the parameters to the query string.

### Example

Change Applejack's hobby to "kickin":

`PATCH /user/47`

```json
{
  "hobby": "kickin"
}
```

[![Run in Postman](https://s3.amazonaws.com/postman-static/run-button.png)](https://www.getpostman.com/run-collection/96217d0d747e536e49a4)

##### Expected Response
```json
{
  "hobby": "kickin",
  "id": 47,
  "name": "Applejack",
  "createdAt": 1485462079725,
  "updatedAt": 1485476060873
}
```

### Socket notifications

If you have WebSockets enabled for your app, then every client [subscribed](http://sailsjs.com/documentation/reference/web-sockets/resourceful-pub-sub) to the updated record will receive a notification where the event name is that of the model identity (e.g. `user`), and the data “payload” has the following format:

```
verb: 'updated',
id: <the record primary key>,
data: <a dictionary of changes made to the record>,
previous: <the record prior to the update>
```

For instance, continuing the example above, all clients subscribed to `User` #47 (_except_ for the client making the request) would receive the following message:

```js
{
  id: 47,
  verb: 'updated',
  data: {
    id: 47,
    hobby: 'kickin'
    updatedAt: 1485476060873
  },
  previous: {
    hobby: 'pickin',
    id: 47,
    name: 'Applejack',
    createdAt: 1485462079725,
    updatedAt: 1485462079725
  }
}
```

**If the update changed any links to other records, there might be some additional notifications:**

If we were reassigning user #47 to store #25, we'd update `store`, which represents the “one” side of a [one-to-many association](http://sailsjs.com/documentation/concepts/models-and-orm/associations/one-to-many) -- for instance:

`PATCH /user/47`

```json
{
  "store": 25
}
```

Clients subscribed to the new store (25) would receive an `addedTo` notification, and a `removedFrom` notification would be sent to any clients subscribed to the old store. (See the [add blueprint reference](http://sailsjs.com/documentation/reference/blueprint-api/add-to) and the [remove blueprint reference](http://sailsjs.com/documentation/reference/blueprint-api/remove-from) for more info about those notifications.)

### Notes

> + This action can be used to update any attribute in a record _except_ for attributes representing a plural ("collection") association.  To update a plural association of a record, use the [add](http://sailsjs.com/documentation/reference/blueprint-api/add-to), [remove](http://sailsjs.com/documentation/reference/blueprint-api/remove-from) or [replace](http://sailsjs.com/documentation/reference/blueprint-api/replace) actions.
> + In previous Sails versions, this action was bound to the `PUT /:model/:id` route.

<docmeta name="displayName" value="update">
<docmeta name="pageType" value="endpoint">