text:
#pragma once
#include <aws/elasticache/ElastiCache_EXPORTS.h>
#include <aws/elasticache/ElastiCacheRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>

namespace Aws
{
namespace ElastiCache
{
namespace Model
{

  /**
   *
Represents the input of a ModifyReplicationGroups operation.

   */
  class AWS_ELASTICACHE_API ModifyReplicationGroupRequest : public ElastiCacheRequest
  {
  public:
    ModifyReplicationGroupRequest();
    Aws::String SerializePayload() const override;

    /**
     *
The identifier of the replication group to modify.

     */
    inline const Aws::String& GetReplicationGroupId() const{ return m_replicationGroupId; }

    /**
     *
The identifier of the replication group to modify.

     */
    inline void SetReplicationGroupId(const Aws::String& value) { m_replicationGroupIdHasBeenSet = true; m_replicationGroupId = value; }

    /**
     *
The identifier of the replication group to modify.

     */
    inline void SetReplicationGroupId(Aws::String&& value) { m_replicationGroupIdHasBeenSet = true; m_replicationGroupId = value; }

    /**
     *
The identifier of the replication group to modify.

     */
    inline void SetReplicationGroupId(const char* value) { m_replicationGroupIdHasBeenSet = true; m_replicationGroupId.assign(value); }

    /**
     *
The identifier of the replication group to modify.

     */
    inline ModifyReplicationGroupRequest& WithReplicationGroupId(const Aws::String& value) { SetReplicationGroupId(value); return *this;}

    /**
     *
The identifier of the replication group to modify.

     */
    inline ModifyReplicationGroupRequest& WithReplicationGroupId(Aws::String&& value) { SetReplicationGroupId(value); return *this;}

    /**
     *
The identifier of the replication group to modify.

     */
    inline ModifyReplicationGroupRequest& WithReplicationGroupId(const char* value) { SetReplicationGroupId(value); return *this;}

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline const Aws::String& GetReplicationGroupDescription() const{ return m_replicationGroupDescription; }

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline void SetReplicationGroupDescription(const Aws::String& value) { m_replicationGroupDescriptionHasBeenSet = true; m_replicationGroupDescription = value; }

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline void SetReplicationGroupDescription(Aws::String&& value) { m_replicationGroupDescriptionHasBeenSet = true; m_replicationGroupDescription = value; }

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline void SetReplicationGroupDescription(const char* value) { m_replicationGroupDescriptionHasBeenSet = true; m_replicationGroupDescription.assign(value); }

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline ModifyReplicationGroupRequest& WithReplicationGroupDescription(const Aws::String& value) { SetReplicationGroupDescription(value); return *this;}

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline ModifyReplicationGroupRequest& WithReplicationGroupDescription(Aws::String&& value) { SetReplicationGroupDescription(value); return *this;}

    /**
     *
A description for the replication group. Maximum length is 255
     * characters.

     */
    inline ModifyReplicationGroupRequest& WithReplicationGroupDescription(const char* value) { SetReplicationGroupDescription(value); return *this;}

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline const Aws::String& GetPrimaryClusterId() const{ return m_primaryClusterId; }

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline void SetPrimaryClusterId(const Aws::String& value) { m_primaryClusterIdHasBeenSet = true; m_primaryClusterId = value; }

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline void SetPrimaryClusterId(Aws::String&& value) { m_primaryClusterIdHasBeenSet = true; m_primaryClusterId = value; }

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline void SetPrimaryClusterId(const char* value) { m_primaryClusterIdHasBeenSet = true; m_primaryClusterId.assign(value); }

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline ModifyReplicationGroupRequest& WithPrimaryClusterId(const Aws::String& value) { SetPrimaryClusterId(value); return *this;}

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline ModifyReplicationGroupRequest& WithPrimaryClusterId(Aws::String&& value) { SetPrimaryClusterId(value); return *this;}

    /**
     *
For replication groups with a single primary, if this parameter is specified,
     * ElastiCache promotes the specified cluster in the specified replication group to
     * the primary role. The nodes of all other clusters in the replication group are
     * read replicas.

     */
    inline ModifyReplicationGroupRequest& WithPrimaryClusterId(const char* value) { SetPrimaryClusterId(value); return *this;}

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline const Aws::String& GetSnapshottingClusterId() const{ return m_snapshottingClusterId; }

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline void SetSnapshottingClusterId(const Aws::String& value) { m_snapshottingClusterIdHasBeenSet = true; m_snapshottingClusterId = value; }

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline void SetSnapshottingClusterId(Aws::String&& value) { m_snapshottingClusterIdHasBeenSet = true; m_snapshottingClusterId = value; }

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline void SetSnapshottingClusterId(const char* value) { m_snapshottingClusterIdHasBeenSet = true; m_snapshottingClusterId.assign(value); }

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline ModifyReplicationGroupRequest& WithSnapshottingClusterId(const Aws::String& value) { SetSnapshottingClusterId(value); return *this;}

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline ModifyReplicationGroupRequest& WithSnapshottingClusterId(Aws::String&& value) { SetSnapshottingClusterId(value); return *this;}

    /**
     *
The cache cluster ID that is used as the daily snapshot source for the
     * replication group. This parameter cannot be set for Redis (cluster mode enabled)
     * replication groups.

     */
    inline ModifyReplicationGroupRequest& WithSnapshottingClusterId(const char* value) { SetSnapshottingClusterId(value); return *this;}

    /**
     *
Determines whether a read replica is automatically promoted to read/write
     * primary if the existing primary encounters a failure.

Valid values:
     * true | false
 <note>
ElastiCache Multi-AZ
     * replication groups are not supported on:

Redis versions earlier
     * than 2.8.6.

Redis (cluster mode disabled):T1 and T2 cache node
     * types.

Redis (cluster mode enabled): T1 node types.

     * </note>
     */
    inline bool GetAutomaticFailoverEnabled() const{ return m_automaticFailoverEnabled; }

    /**
     *
Determines whether a read replica is automatically promoted to read/write
     * primary if the existing primary encounters a failure.

Valid values:
     * true | false
 <note>
ElastiCache Multi-AZ
     * replication groups are not supported on:

Redis versions earlier
     * than 2.8.6.

Redis (cluster mode disabled):T1 and T2 cache node
     * types.

Redis (cluster mode enabled): T1 node types.

     * </note>
     */
    inline void SetAutomaticFailoverEnabled(bool value) { m_automaticFailoverEnabledHasBeenSet = true; m_automaticFailoverEnabled = value; }

    /**
     *
Determines whether a read replica is automatically promoted to read/write
     * primary if the existing primary encounters a failure.

Valid values:
     * true | false
 <note>
ElastiCache Multi-AZ
     * replication groups are not supported on:

Redis versions earlier
     * than 2.8.6.

Redis (cluster mode disabled):T1 and T2 cache node
     * types.

Redis (cluster mode enabled): T1 node types.

     * </note>
     */
    inline ModifyReplicationGroupRequest& WithAutomaticFailoverEnabled(bool value) { SetAutomaticFailoverEnabled(value); return *this;}

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline const Aws::Vector<Aws::String>& GetCacheSecurityGroupNames() const{ return m_cacheSecurityGroupNames; }

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline void SetCacheSecurityGroupNames(const Aws::Vector<Aws::String>& value) { m_cacheSecurityGroupNamesHasBeenSet = true; m_cacheSecurityGroupNames = value; }

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline void SetCacheSecurityGroupNames(Aws::Vector<Aws::String>&& value) { m_cacheSecurityGroupNamesHasBeenSet = true; m_cacheSecurityGroupNames = value; }

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline ModifyReplicationGroupRequest& WithCacheSecurityGroupNames(const Aws::Vector<Aws::String>& value) { SetCacheSecurityGroupNames(value); return *this;}

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline ModifyReplicationGroupRequest& WithCacheSecurityGroupNames(Aws::Vector<Aws::String>&& value) { SetCacheSecurityGroupNames(value); return *this;}

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline ModifyReplicationGroupRequest& AddCacheSecurityGroupNames(const Aws::String& value) { m_cacheSecurityGroupNamesHasBeenSet = true; m_cacheSecurityGroupNames.push_back(value); return *this; }

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline ModifyReplicationGroupRequest& AddCacheSecurityGroupNames(Aws::String&& value) { m_cacheSecurityGroupNamesHasBeenSet = true; m_cacheSecurityGroupNames.push_back(value); return *this; }

    /**
     *
A list of cache security group names to authorize for the clusters in this
     * replication group. This change is asynchronously applied as soon as
     * possible.

This parameter can be used only with replication group
     * containing cache clusters running outside of an Amazon Virtual Private Cloud
     * (Amazon VPC).

Constraints: Must contain no more than 255 alphanumeric
     * characters. Must not be Default.

     */
    inline ModifyReplicationGroupRequest& AddCacheSecurityGroupNames(const char* value) { m_cacheSecurityGroupNamesHasBeenSet = true; m_cacheSecurityGroupNames.push_back(value); return *this; }

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const{ return m_securityGroupIds; }

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline void SetSecurityGroupIds(const Aws::Vector<Aws::String>& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds = value; }

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline void SetSecurityGroupIds(Aws::Vector<Aws::String>&& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds = value; }

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline ModifyReplicationGroupRequest& WithSecurityGroupIds(const Aws::Vector<Aws::String>& value) { SetSecurityGroupIds(value); return *this;}

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline ModifyReplicationGroupRequest& WithSecurityGroupIds(Aws::Vector<Aws::String>&& value) { SetSecurityGroupIds(value); return *this;}

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline ModifyReplicationGroupRequest& AddSecurityGroupIds(const Aws::String& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.push_back(value); return *this; }

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline ModifyReplicationGroupRequest& AddSecurityGroupIds(Aws::String&& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.push_back(value); return *this; }

    /**
     *
Specifies the VPC Security Groups associated with the cache clusters in the
     * replication group.

This parameter can be used only with replication group
     * containing cache clusters running in an Amazon Virtual Private Cloud (Amazon
     * VPC).

     */
    inline ModifyReplicationGroupRequest& AddSecurityGroupIds(const char* value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.push_back(value); return *this; }

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline const Aws::String& GetPreferredMaintenanceWindow() const{ return m_preferredMaintenanceWindow; }

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline void SetPreferredMaintenanceWindow(const Aws::String& value) { m_preferredMaintenanceWindowHasBeenSet = true; m_preferredMaintenanceWindow = value; }

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline void SetPreferredMaintenanceWindow(Aws::String&& value) { m_preferredMaintenanceWindowHasBeenSet = true; m_preferredMaintenanceWindow = value; }

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline void SetPreferredMaintenanceWindow(const char* value) { m_preferredMaintenanceWindowHasBeenSet = true; m_preferredMaintenanceWindow.assign(value); }

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline ModifyReplicationGroupRequest& WithPreferredMaintenanceWindow(const Aws::String& value) { SetPreferredMaintenanceWindow(value); return *this;}

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline ModifyReplicationGroupRequest& WithPreferredMaintenanceWindow(Aws::String&& value) { SetPreferredMaintenanceWindow(value); return *this;}

    /**
     *
Specifies the weekly time range during which maintenance on the cluster is
     * performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H
     * Clock UTC). The minimum maintenance window is a 60 minute period.

Valid
     * values for ddd are:

 sun

     *

 mon

 tue

     *
 wed

 thu

     * fri

 sat

     *
Example: sun:23:00-mon:01:30

     */
    inline ModifyReplicationGroupRequest& WithPreferredMaintenanceWindow(const char* value) { SetPreferredMaintenanceWindow(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline const Aws::String& GetNotificationTopicArn() const{ return m_notificationTopicArn; }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline void SetNotificationTopicArn(const Aws::String& value) { m_notificationTopicArnHasBeenSet = true; m_notificationTopicArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline void SetNotificationTopicArn(Aws::String&& value) { m_notificationTopicArnHasBeenSet = true; m_notificationTopicArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline void SetNotificationTopicArn(const char* value) { m_notificationTopicArnHasBeenSet = true; m_notificationTopicArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline ModifyReplicationGroupRequest& WithNotificationTopicArn(const Aws::String& value) { SetNotificationTopicArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline ModifyReplicationGroupRequest& WithNotificationTopicArn(Aws::String&& value) { SetNotificationTopicArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications
     * are sent.
 <note>
The Amazon SNS topic owner must be same as the
     * replication group owner.
 </note>
     */
    inline ModifyReplicationGroupRequest& WithNotificationTopicArn(const char* value) { SetNotificationTopicArn(value); return *this;}

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline const Aws::String& GetCacheParameterGroupName() const{ return m_cacheParameterGroupName; }

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline void SetCacheParameterGroupName(const Aws::String& value) { m_cacheParameterGroupNameHasBeenSet = true; m_cacheParameterGroupName = value; }

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline void SetCacheParameterGroupName(Aws::String&& value) { m_cacheParameterGroupNameHasBeenSet = true; m_cacheParameterGroupName = value; }

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline void SetCacheParameterGroupName(const char* value) { m_cacheParameterGroupNameHasBeenSet = true; m_cacheParameterGroupName.assign(value); }

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline ModifyReplicationGroupRequest& WithCacheParameterGroupName(const Aws::String& value) { SetCacheParameterGroupName(value); return *this;}

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline ModifyReplicationGroupRequest& WithCacheParameterGroupName(Aws::String&& value) { SetCacheParameterGroupName(value); return *this;}

    /**
     *
The name of the cache parameter group to apply to all of the clusters in this
     * replication group. This change is asynchronously applied as soon as possible for
     * parameters when the ApplyImmediately parameter is specified as
     * true for this request.

     */
    inline ModifyReplicationGroupRequest& WithCacheParameterGroupName(const char* value) { SetCacheParameterGroupName(value); return *this;}

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline const Aws::String& GetNotificationTopicStatus() const{ return m_notificationTopicStatus; }

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline void SetNotificationTopicStatus(const Aws::String& value) { m_notificationTopicStatusHasBeenSet = true; m_notificationTopicStatus = value; }

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline void SetNotificationTopicStatus(Aws::String&& value) { m_notificationTopicStatusHasBeenSet = true; m_notificationTopicStatus = value; }

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline void SetNotificationTopicStatus(const char* value) { m_notificationTopicStatusHasBeenSet = true; m_notificationTopicStatus.assign(value); }

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline ModifyReplicationGroupRequest& WithNotificationTopicStatus(const Aws::String& value) { SetNotificationTopicStatus(value); return *this;}

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline ModifyReplicationGroupRequest& WithNotificationTopicStatus(Aws::String&& value) { SetNotificationTopicStatus(value); return *this;}

    /**
     *
The status of the Amazon SNS notification topic for the replication group.
     * Notifications are sent only if the status is active.

Valid
     * values: active | inactive

     */
    inline ModifyReplicationGroupRequest& WithNotificationTopicStatus(const char* value) { SetNotificationTopicStatus(value); return *this;}

    /**
     *
If true, this parameter causes the modifications in this request
     * and any pending modifications to be applied, asynchronously and as soon as
     * possible, regardless of the PreferredMaintenanceWindow setting for
     * the replication group.

If false, changes to the nodes in the
     * replication group are applied on the next maintenance reboot, or the next
     * failure reboot, whichever occurs first.

Valid values: true |
     * false

Default: false

     */
    inline bool GetApplyImmediately() const{ return m_applyImmediately; }

    /**
     *
If true, this parameter causes the modifications in this request
     * and any pending modifications to be applied, asynchronously and as soon as
     * possible, regardless of the PreferredMaintenanceWindow setting for
     * the replication group.

If false, changes to the nodes in the
     * replication group are applied on the next maintenance reboot, or the next
     * failure reboot, whichever occurs first.

Valid values: true |
     * false

Default: false

     */
    inline void SetApplyImmediately(bool value) { m_applyImmediatelyHasBeenSet = true; m_applyImmediately = value; }

    /**
     *
If true, this parameter causes the modifications in this request
     * and any pending modifications to be applied, asynchronously and as soon as
     * possible, regardless of the PreferredMaintenanceWindow setting for
     * the replication group.

If false, changes to the nodes in the
     * replication group are applied on the next maintenance reboot, or the next
     * failure reboot, whichever occurs first.

Valid values: true |
     * false

Default: false

     */
    inline ModifyReplicationGroupRequest& WithApplyImmediately(bool value) { SetApplyImmediately(value); return *this;}

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline const Aws::String& GetEngineVersion() const{ return m_engineVersion; }

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline void SetEngineVersion(const Aws::String& value) { m_engineVersionHasBeenSet = true; m_engineVersion = value; }

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline void SetEngineVersion(Aws::String&& value) { m_engineVersionHasBeenSet = true; m_engineVersion = value; }

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline void SetEngineVersion(const char* value) { m_engineVersionHasBeenSet = true; m_engineVersion.assign(value); }

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline ModifyReplicationGroupRequest& WithEngineVersion(const Aws::String& value) { SetEngineVersion(value); return *this;}

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline ModifyReplicationGroupRequest& WithEngineVersion(Aws::String&& value) { SetEngineVersion(value); return *this;}

    /**
     *
The upgraded version of the cache engine to be run on the cache clusters in
     * the replication group.

 Important: You can upgrade to a newer
     * engine version (see Selecting
     * a Cache Engine and Version), but you cannot downgrade to an earlier engine
     * version. If you want to use an earlier engine version, you must delete the
     * existing replication group and create it anew with the earlier engine version.
     *

     */
    inline ModifyReplicationGroupRequest& WithEngineVersion(const char* value) { SetEngineVersion(value); return *this;}

    /**
     *
This parameter is currently disabled.

     */
    inline bool GetAutoMinorVersionUpgrade() const{ return m_autoMinorVersionUpgrade; }

    /**
     *
This parameter is currently disabled.

     */
    inline void SetAutoMinorVersionUpgrade(bool value) { m_autoMinorVersionUpgradeHasBeenSet = true; m_autoMinorVersionUpgrade = value; }

    /**
     *
This parameter is currently disabled.

     */
    inline ModifyReplicationGroupRequest& WithAutoMinorVersionUpgrade(bool value) { SetAutoMinorVersionUpgrade(value); return *this;}

    /**
     *
The number of days for which ElastiCache retains automatic node group (shard)
     * snapshots before deleting them. For example, if you set
     * SnapshotRetentionLimit to 5, a snapshot that was taken today is
     * retained for 5 days before being deleted.

 Important If the value
     * of SnapshotRetentionLimit is set to zero (0), backups are turned off.

     */
    inline int GetSnapshotRetentionLimit() const{ return m_snapshotRetentionLimit; }

    /**
     *
The number of days for which ElastiCache retains automatic node group (shard)
     * snapshots before deleting them. For example, if you set
     * SnapshotRetentionLimit to 5, a snapshot that was taken today is
     * retained for 5 days before being deleted.

 Important If the value
     * of SnapshotRetentionLimit is set to zero (0), backups are turned off.

     */
    inline void SetSnapshotRetentionLimit(int value) { m_snapshotRetentionLimitHasBeenSet = true; m_snapshotRetentionLimit = value; }

    /**
     *
The number of days for which ElastiCache retains automatic node group (shard)
     * snapshots before deleting them. For example, if you set
     * SnapshotRetentionLimit to 5, a snapshot that was taken today is
     * retained for 5 days before being deleted.

 Important If the value
     * of SnapshotRetentionLimit is set to zero (0), backups are turned off.

     */
    inline ModifyReplicationGroupRequest& WithSnapshotRetentionLimit(int value) { SetSnapshotRetentionLimit(value); return *this;}

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline const Aws::String& GetSnapshotWindow() const{ return m_snapshotWindow; }

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline void SetSnapshotWindow(const Aws::String& value) { m_snapshotWindowHasBeenSet = true; m_snapshotWindow = value; }

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline void SetSnapshotWindow(Aws::String&& value) { m_snapshotWindowHasBeenSet = true; m_snapshotWindow = value; }

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline void SetSnapshotWindow(const char* value) { m_snapshotWindowHasBeenSet = true; m_snapshotWindow.assign(value); }

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline ModifyReplicationGroupRequest& WithSnapshotWindow(const Aws::String& value) { SetSnapshotWindow(value); return *this;}

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline ModifyReplicationGroupRequest& WithSnapshotWindow(Aws::String&& value) { SetSnapshotWindow(value); return *this;}

    /**
     *
The daily time range (in UTC) during which ElastiCache begins taking a daily
     * snapshot of the node group (shard) specified by
     * SnapshottingClusterId.

Example: 05:00-09:00
     *

If you do not specify this parameter, ElastiCache automatically chooses
     * an appropriate time range.

     */
    inline ModifyReplicationGroupRequest& WithSnapshotWindow(const char* value) { SetSnapshotWindow(value); return *this;}

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline const Aws::String& GetCacheNodeType() const{ return m_cacheNodeType; }

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline void SetCacheNodeType(const Aws::String& value) { m_cacheNodeTypeHasBeenSet = true; m_cacheNodeType = value; }

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline void SetCacheNodeType(Aws::String&& value) { m_cacheNodeTypeHasBeenSet = true; m_cacheNodeType = value; }

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline void SetCacheNodeType(const char* value) { m_cacheNodeTypeHasBeenSet = true; m_cacheNodeType.assign(value); }

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline ModifyReplicationGroupRequest& WithCacheNodeType(const Aws::String& value) { SetCacheNodeType(value); return *this;}

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline ModifyReplicationGroupRequest& WithCacheNodeType(Aws::String&& value) { SetCacheNodeType(value); return *this;}

    /**
     *
A valid cache node type that you want to scale this replication group to.

     */
    inline ModifyReplicationGroupRequest& WithCacheNodeType(const char* value) { SetCacheNodeType(value); return *this;}

  private:
    Aws::String m_replicationGroupId;
    bool m_replicationGroupIdHasBeenSet;
    Aws::String m_replicationGroupDescription;
    bool m_replicationGroupDescriptionHasBeenSet;
    Aws::String m_primaryClusterId;
    bool m_primaryClusterIdHasBeenSet;
    Aws::String m_snapshottingClusterId;
    bool m_snapshottingClusterIdHasBeenSet;
    bool m_automaticFailoverEnabled;
    bool m_automaticFailoverEnabledHasBeenSet;
    Aws::Vector<Aws::String> m_cacheSecurityGroupNames;
    bool m_cacheSecurityGroupNamesHasBeenSet;
    Aws::Vector<Aws::String> m_securityGroupIds;
    bool m_securityGroupIdsHasBeenSet;
    Aws::String m_preferredMaintenanceWindow;
    bool m_preferredMaintenanceWindowHasBeenSet;
    Aws::String m_notificationTopicArn;
    bool m_notificationTopicArnHasBeenSet;
    Aws::String m_cacheParameterGroupName;
    bool m_cacheParameterGroupNameHasBeenSet;
    Aws::String m_notificationTopicStatus;
    bool m_notificationTopicStatusHasBeenSet;
    bool m_applyImmediately;
    bool m_applyImmediatelyHasBeenSet;
    Aws::String m_engineVersion;
    bool m_engineVersionHasBeenSet;
    bool m_autoMinorVersionUpgrade;
    bool m_autoMinorVersionUpgradeHasBeenSet;
    int m_snapshotRetentionLimit;
    bool m_snapshotRetentionLimitHasBeenSet;
    Aws::String m_snapshotWindow;
    bool m_snapshotWindowHasBeenSet;
    Aws::String m_cacheNodeType;
    bool m_cacheNodeTypeHasBeenSet;
  };

} // namespace Model
} // namespace ElastiCache
} // namespace Aws


text:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <ns1:RequestHeader soapenv:mustUnderstand="0" xmlns:ns1="http://www.doubleclick.net/dfa-api/#API_VERSION#">
      <ns1:applicationName mustUnderstand="0" actor="">TEST_APP (DfaApi-Java, Dfa-Axis/1.35.1, Common-Java/1.35.1, Axis/1.4, Java/#JAVA_VERSION#, maven)</ns1:applicationName>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
    <ns2:authenticate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://www.doubleclick.net/dfa-api/#API_VERSION#">
      <username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">TEST_USERNAME</username>
      <password xsi:type="soapenc:string" xsi:nil="true" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
    </ns2:authenticate>
  </soapenv:Body>
</soapenv:Envelope>

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace CjClutter.Commons.Extensions
{
    public static class DoubleExtensions
    {
         public static double Clamp(this double d, double min, double max)
         {
             var clampedToMax = Math.Min(d, max);
             var clampedToMin = Math.Max(clampedToMax, min);
             return clampedToMin;
         }
    }
}


text:
var http = require('http'),
    parse = require('url').parse,
    qs = require('qs'),
    util = require('util'),
    events = require('events'),
    middleware = require('./middleware'),
    Router = require('apiserver-router'),
    Chain = require('fnchain')

var ApiServer = module.exports = function (options) {
  var self = this
  ApiServer.super_.call(this)

  options = (options !== null && options !== undefined && options.constructor === Object) ? options : {}
  options.timeout = !options.timeout || options.timeout < 0 ? 15000 : options.timeout
  options.standardHeaders = options.standardHeaders || {
    'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',
    'expires': 0,
    'pragma': 'no-cache',
    'x-server': 'ApiServer v' + ApiServer.version + ' raging on nodejs ' + process.version
  }
  options.port = options.port || 8080
  options.server = options.server || http.createServer()
  options.router = options.router || new Router(options)

  Object.keys(options).forEach(function (key) {
    if (!self.__proto__.hasOwnProperty(key)) {
      self[key] = options[key]
    }
  })

  this.JSONTransport = middleware.JSONTransport(this, options)
  this.middlewareList = []
  this.activeApiModules = {}
  this.server.on('request', onRequest.bind(this))
}

module.exports.version = require('../package').version

util.inherits(module.exports, events.EventEmitter)

ApiServer.prototype.addModule = function (apiVersion, moduleName, module) {
  if (this.activeApiModules[apiVersion] === undefined) {
    this.activeApiModules[apiVersion] = Object.create(null)
  }
  this.activeApiModules[apiVersion][moduleName] = module
  this.router.update(this.activeApiModules, this.middlewareList)
  return this
}

ApiServer.prototype.use = function () {
  var args = Array.prototype.slice.call(arguments)
  var middleware = args.pop()
  var route = args.pop() || /./
  this.middlewareList.push({
    route: route,
    handle: middleware
  })
  this.router.update(this.activeApiModules, this.middlewareList)
  return this
}

ApiServer.prototype.listen = function () {
  var arguments = Array.prototype.slice.call(arguments)
  var port = this.port, hostname, callback
  arguments.forEach(function (arg) {
    if (typeof arg === 'function') {
      callback = arg
      return
    }
    if (typeof arg === 'string' && isNaN(Number(arg))) {
      hostname = arg
      return
    }
    if (!isNaN(Number(arg))) {
      port = arg
      return
    }
  })
  this.server.listen(port, hostname, callback)
}

ApiServer.prototype.close = function (callback) {
  callback && this.server.once('close', callback)
  this.server.close()
}

// export middleware
Object.keys(middleware).forEach(function (middlewareName) {
  module.exports[middlewareName] = middleware[middlewareName]
})

// private
function onRequest(request, response) {
  var self = this
  var end = response.end
  var parsed = parse(request.url, true)

  request.requestedAt = request.at = new Date().getTime()
  request.parsedUrl = parse(request.url, true)
  request.pathname = request.path = request.parsedUrl.pathname.replace(/\/\/+/g, '/')
  request.querystring = request.qs = qs.parse(request.parsedUrl.search.replace(/^\?/, ''))
  request.pause()
  request.timeout = setInterval(function () {
    response.writeHead(408)
    end.call(response)
    clearInterval(request.timeout)
    self.emit('timeout', request.url)
  }, this.timeout)

  response.end = function () {
    clearInterval(request.timeout)
    end.apply(this, arguments)
    self.emit('requestEnd', request.url, new Date().getTime() - request.requestedAt)
  }

  this.emit('requestStart', request.url, request.requestedAt)
  this.JSONTransport(request, response)

  var executionChain = this.router.get(request)

  if (!executionChain) {
    return response.serveJSON({
      success: false,
      reason: request.pathname + ' api not found'
    }, {
      httpStatusCode: 404,
    })
  }

  new Chain(executionChain, function (err) {
    if (err) {
      response.serveJSON({
        success: false,
        reason: 'something went wrong: ' + err,
        stack: err.stack
      }, {
        httpStatusCode: 500
      })
      self.emit('error', request.url, err)
    }
  }).call(request, response)
}


text:
/**
 * For those familiar with Java, FOAM Enums are very similar to Java enums in
 * design.
 *
 * An Enum is essentially a class with a fixed number of named instances.
 * The instances are frequently referred to as Enum Values, or the 'values'
 * of an Enum.
 *
 * Enums have most of the features available to FOAM classes, including
 * properties, methods, constants, templates, and listeners.
 *
 * Enums extend from FObject, so they inherit FObject features such as
 * pub/sub events, diffing, hashCode, etc.
 *
 * Enums also have a few built-in properties by default. Every Enum has an
 * 'ordinal' property, which is a integer unique to all the Enum Values of a
 * particular Enum. Each enum also has a 'name' property, which is the name
 * given to each Enum Value.
 *
 * Example usage:
 * <pre>
 * // To define an enum we use the foam.ENUM() function.
 * foam.ENUM({
 *   name: 'IssueStatus',
 *
 *   // Enums share many features with regular classes, the properties
 *   // and methods we want our enums to have are defined as follows.
 *   properties: [
 *     {
 *       class: 'Boolean',
 *       name: 'consideredOpen',
 *       value: true
 *     }
 *   ],
 *
 *   methods: [
 *     function foo() {
 *       return this.label + ( this.consideredOpen ? ' is' : ' is not' ) +
 *           ' considered open.';
 *     }
 *   ],
 *
 *   // Use the values: key to define the actual Enum Values that we
 *   // want to exist.
 *   values: [
 *     {
 *       name: 'OPEN'
 *     },
 *     {
 *       // The ordinal can be specified explicitly.
 *       name: 'CLOSED',
 *       ordinal: 100
 *     },
 *     {
 *       // If the ordinal isn't given explicitly it is auto assigned as
 *       // the previous ordinal + 1
 *       name: 'ASSIGNED'
 *     },
 *     {
 *       // You can specify the label, which will be used when rendering in a
 *       // combo box or similar
 *       name: 'UNVERIFIED',
 *       label: 'Unverified'
 *     },
 *     {
 *       // Values for additional properties to your enum are also defined
 *       // inline.
 *       name: 'FIXED',
 *       label: 'Fixed',
 *       consideredOpen: false
 *     }
 *   ]
 * });
 *
 * console.log(IssueStatus.OPEN.name); // outputs "OPEN"
 * console.log(IssueStatus.ASSIGNED.consideredOpen); // outputs "true"
 *
 * // Enum value ordinals can be specified.
 * console.log(IssueStatus.CLOSED.ordinal); // outputs 100
 * // values without specified ordinals get auto assigned.
 * console.log(IssueStatus.ASSIGNED.ordinal); // outputs 101
 *
 * // Methods can be called on the enum values.
 * // outputs "Fixed is not considered open."
 * console.log(IssueStatus.FIXED.foo());
 *
 * // To store enums on a class, it is recommended to use the Enum property
 * // type.
 * foam.CLASS({
 *   name: 'Issue',
 *   properties: [
 *     {
 *       class: 'Enum',
 *       of: 'IssueStatus',
 *       name: 'status'
 *     }
 *   ]
 * });
 *
 * var issue = Issue.create({ status: IssueStatus.UNVERIFIED });
 * console.log(issue.status.label); // outputs "Unverified"
 *
 * // Enum properties give you some convenient adapting.
 * // You can set the property to the ordinal or the
 * // name of an enum, and it will set the property
 * // to the correct Enum value.
 *
 * issue.status = 100;
 *
 * issue.status === IssueStatus.CLOSED; // is true
 *
 * // Enum properties also allow you to assign them via the name
 * // of the enum.
 *
 * issue.status = "ASSIGNED"
 *
 * issue.status === IssueStatus.ASSIGNED; // is true
 *
 * The extent of all Enum values can be accessed from either the collection or from any
 * individual Enum value:
 * console.log(IssueStatus.VALUES, IssueStatus.CLOSED.VALUES);
 *
 * Values can be specified as just Strings if you don't want to explicitly set the label
 * or ordinal. Ex.:
 *
 * foam.ENUM({
 *  name: 'DaysOfWeek',
 *  values: [
 *    'SUNDAY',
 *    'MONDAY',
 *    'TUESDAY',
 *    'WEDNESDAY',
 *    'THURSDAY',
 *    'FRIDAY',
 *    'SATURDAY'
 *  ]
 * });
 *
 * </pre>
 */
// TODO: Make extend Model so can override methods (or do some other way).
foam.CLASS({
  package: 'foam.core.internal',
  name: 'EnumValueAxiom',

  documentation: 'The definition of a single Enum value.',

  properties: [
    {
      name: 'ordinal',
      getter: function() { return this.definition.ordinal; },
      setter: function(o) { this.definition.ordinal = o; }
    },
    {
      name: 'name',
      getter: function() { return this.definition.name; }
    },
    'definition',
    // Late priority setting, so that properties/implements etc are defined first.
    [ 'priority', 50 ]
  ],

  methods: [
    function installInClass(cls) {
      var e = cls.create(this.definition);
      cls.installConstant(this.name, e);
      cls.VALUES.push(e);
    }
  ]
});

foam.CLASS({
  package: 'foam.core',
  name: 'EnumModel',
  extends: 'Model',

  requires: [
    'foam.core.internal.EnumValueAxiom',
  ],

  documentation: 'Model for defining Enum(erations).',

  properties: [
    [ 'extends', 'foam.core.AbstractEnum' ],
    {
      class: 'AxiomArray',
      of: 'foam.core.internal.EnumValueAxiom',
      name: 'values',
      toJSON: function(values, out) {
        return values.map(function(v) { return v.definition; });
      },
      adapt: function(_, v) {
        var used = {}; // map of ordinals used to check for duplicates

        var next = 0;
        for ( var i = 0 ; i < v.length ; i++ ) {
          var def = v[i];

          if ( foam.String.isInstance(def) ) {
            def = { label: def, name: foam.String.constantize(def) };
          }

          def = this.EnumValueAxiom.isInstance(def) ? def :
            def.class ? this.__context__.lookup(def.class).create(def) :
            this.EnumValueAxiom.create({definition: def});

          v[i] = def;

          if ( def.definition.ordinal == undefined ) {
            def.ordinal = next;
          }
          next = Math.max(def.ordinal + 1, next);

          if ( used[def.ordinal] ) {
            throw this.id +
              ' Enum error: duplicate ordinal found ' + def.name + ' ' +
              used[def.ordinal] + ' both have an ordinal of ' + def.ordinal;
          }

          used[def.ordinal] = def.name;
        }

        return v;
      }
    }
  ]
});

foam.CLASS({
  package: 'foam.core',
  name: 'AbstractEnum',

  documentation: 'Abstract base class for all Enum classes.',

  axioms: [
    foam.pattern.Multiton.create({property: 'ordinal'}),
    {
      installInClass: function(cls) {
        // Each sub-class of AbstractEnum gets it's own VALUES array.
        Object.defineProperty(cls, 'VALUES', {
          get: function() {
            return this.private_.VALUES || ( this.private_.VALUES = [] );
          },
          configurable: true,
          enumerable: false
        });
      },
      installInProto: function(p) {
        Object.defineProperty(p, 'VALUES', {
          get: function() { return this.cls_.VALUES; },
          configurable: true,
          enumerable: false
        });
      }
    }
  ],

  static: [
    function forOrdinal(i) {
      return this.VALUES.find((e) => e.ordinal == i);
    }
  ],

  properties: [
    {
      class: 'String',
      name: 'documentation',
      transient: true
    },
    {
      class: 'Int',
      name: 'ordinal',
      // NOTE: Default value of -1 forces legitimate values (starting at 0) to
      // all be non-default. This is important for, e.g., serialization of enum
      // values:
      // https://github.com/foam-framework/foam2/issues/637
      value: -1,
      final: true
    },
    {
      class: 'String',
      name: 'name',
      transient: true,
      final: true
    },
    {
      class: 'String',
      name: 'label',
      transient: true,
      factory: function() { return this.name; }
    },
    {
      class: 'String',
      name: 'color'
    },
    {
      class: 'String',
      name: 'background'
    },
    {
      class: 'Boolean',
      name: 'isItalic'
    },
    {
      class: 'Boolean',
      name: 'isBold'
    },
    {
      class: 'StringArray',
      name: 'extraClasses',
      generateJava: false
    }
  ],

  methods: [
    function outputFObject(o) {
      o.out(this.ordinal);
    },
    function toSummary() { return this.label; },
    function toStyle() {
      var style = {
        'display': 'inline-block'
      };

      if ( this.color      ) style.color          = this.color;
      if ( this.background ) style.background     = this.background;
      if ( this.isItalic   ) style['font-style']  = 'italic';
      if ( this.isBold     ) style['font-weight'] = 'bold';

      return style;
    },
    function classes() {
      return this.extraClasses.concat(foam.String.cssClassize(this.cls_.id) + '-' + this.name);
    },
    function toString() { return this.name; }
  ]
});

foam.CLASS({
  package: 'foam.core',
  name: 'Enum',
  extends: 'Property',

  documentation: 'A Property type for storing enum values.',

  properties: [
    // TODO: 'of' or 'type'?
    {
      class: 'Class',
      name: 'of',
      required: true
    },
    {
      name: 'type',
      factory: function() { return this.of.id; }
    },
    {
      name: 'value',
      // TODO: shouldn't be required
      adapt: function(_, n) {
        if ( foam.String.isInstance(n) ) n = foam.lookup(this.type)[n];
        if ( foam.Object.isInstance(n) && n.class )
          n = foam.lookup(n.class).create(n);
        return n
      },
      expression: function(type) {
        return type && foam.lookup(type).VALUES[0];
      }
    },
    {
      name: 'javaValue',
      flags: ['java'],
      expression: function(type, value) {
        return foam.lookup(type).id + '.' + value;
      }
    },
    [
      'adapt',
      function(o, n, prop) {
        var type = foam.lookup(prop.type);

        if ( n && typeof n === 'function' ) n = n();

        if ( n && n.cls_ === type ) return n;

        var valueType = foam.typeOf(n), ret;

        if ( valueType === foam.String ) {
          ret = type[foam.String.constantize(n)];
        } else if ( valueType === foam.Number ) {
          ret = type.create({ordinal: n}, foam.__context__);
        } else if ( valueType === foam.Object ) {
          ret = type.create(n, foam.__context__);
        }

        if ( ret ) return ret;

        throw new Error('Attempt to set invalid Enum value. Enum: ' + type.id + ', value: ' + n);
      }
    ],
    {
      name: 'toJSON',
      value: function(value) { return value.ordinal; }
    }
  ]
});

foam.LIB({
  name: 'foam',

  methods: [
    function ENUM(m) {
      m.class = m.class || 'foam.core.EnumModel';
      return foam.CLASS(m);
    }
  ]
});


text:
Disnode

Software Powering Communities

[![Discord](https://discordapp.com/api/guilds/236338097955143680/widget.png)](https://discord.gg/AbZhCen)

### [Offical Docs](https://disnode.readme.io/docs)

### Getting Started:

#### Installing
`npm install disnode --save && npm install`
##### Bot Config
Make a file called Bot-Config.json in `/bots` and fill it in with your bots information
```json
  {
  "key": "Bot Token Here",
     "prefix" : "Bot Prefix",
  "db": {
     "use_db" : false,
     "auth" : false,
     "user" : "",
     "pass" : "",
     "host" : "",
     "port" : "",
     "DBName" : ""
        }
  }
  ```
##### Starting Up
 `node Run.js` or [pm2](http://pm2.keymetrics.io/) can run your bot.


text:
@implementation CBPWordPressImage
- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:@(self.height) forKey:@"height"];
    [encoder encodeObject:self.url forKey:@"url"];
    [encoder encodeObject:@(self.width) forKey:@"width"];
}

- (id)initWithCoder:(NSCoder *)decoder
{
    if ((self = [super init])) {
        self.height = [(NSNumber *)[decoder decodeObjectForKey:@"height"] integerValue];
        self.url = [decoder decodeObjectForKey:@"url"];
        self.width = [(NSNumber *)[decoder decodeObjectForKey:@"width"] integerValue];
    }
    return self;
}

+ (instancetype)initFromDictionary:(NSDictionary *)aDictionary
{

    CBPWordPressImage *instance = [[CBPWordPressImage alloc] init];
    [instance setAttributesFromDictionary:aDictionary];
    return instance;

}

- (void)setAttributesFromDictionary:(NSDictionary *)aDictionary
{

    if (![aDictionary isKindOfClass:[NSDictionary class]]) {
        return;
    }

    [self setValuesForKeysWithDictionary:aDictionary];

}

- (NSDictionary *)dictionaryRepresentation
{

    NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];

    [dictionary setObject:@(self.height) forKey:@"height"];

    if (self.url) {
        [dictionary setObject:self.url forKey:@"url"];
    }

    [dictionary setObject:@(self.width) forKey:@"width"];

    return dictionary;

}

@end


text:
module Clubhouse
  module Concerns
    module Services
      module CreateInvitation
        extend ActiveSupport::Concern

        include Servitore::Service

        included do
          param_reader :invitation, :params
        end

        def call
          invitation.tap do |i|
            i.assign_attributes(params)
            i.save!
            Mailer.invitation(i).deliver_later
          end
        end
      end
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Starter Template for Bootstrap</title>

    <!link href="../static/css/bootstrap-grid.min.css" rel="stylesheet">
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">

    <link href="starter-template.css" rel="stylesheet">

Input Page

Enter some user input

      <form  action="/output" method="GET">

          Provider ID:
          <input type="text" id="provider" name='provider' placeholder="e.g. 10001 ">

          <button type="submit" class="btn btn-default btn-lg">Find proivder info!</button>

      </form>


text:
<?php
$urlpatch = (strpos($_SERVER['DOCUMENT_ROOT'], 'xampp') == true)?'/dimli':'';
if(!defined('MAIN_DIR')){define('MAIN_DIR',$_SERVER['DOCUMENT_ROOT'].$urlpatch);}
require_once(MAIN_DIR.'/_php/_config/session.php');
require_once(MAIN_DIR.'/_php/_config/connection.php');
require_once(MAIN_DIR.'/_php/_config/functions.php');
confirm_logged_in();
require_priv('priv_catalog');

// --------------------------------
// Create arrays of each data type
// --------------------------------

$_SESSION['titleArray']=$_SESSION['agentArray']=$_SESSION['dateArray']=
$_SESSION['materialArray']=$_SESSION['techniqueArray']=$_SESSION['workTypeArray']=
$_SESSION['culturalContextArray']=$_SESSION['stylePeriodArray']=$_SESSION['locationArray']=
$_SESSION['descriptionArray']=$_SESSION['stateEditionArray']=$_SESSION['measurementsArray']=
$_SESSION['subjectArray']=$_SESSION['inscriptionArray']=$_SESSION['rightsArray']=
$_SESSION['sourceArray']= array();

foreach ($_POST['json'] as $key => $value) {

	if (preg_match('/title/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['titleArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['titleArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['titleArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/agent/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['agentArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['agentArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['agentArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/(Date|date)/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['dateArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['dateArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['dateArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/material/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['materialArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['materialArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['materialArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/technique/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['techniqueArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['techniqueArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['techniqueArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/workType/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['workTypeArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['workTypeArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['workTypeArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/culturalContext/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['culturalContextArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['culturalContextArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['culturalContextArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/stylePeriod/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['stylePeriodArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['stylePeriodArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['stylePeriodArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/location/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['locationArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['locationArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['locationArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/description/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['descriptionArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['descriptionArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['descriptionArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/stateEdition/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['stateEditionArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['stateEditionArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['stateEditionArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/(Measure|measure|inches|days|hours|minutes|seconds|fileSize|resolution|weight)/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['measurementsArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['measurementsArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['measurementsArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/subject/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['subjectArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['subjectArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['subjectArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/(Inscription|inscription)/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['inscriptionArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['inscriptionArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['inscriptionArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match('/rights/', $key)) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['rightsArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['rightsArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['rightsArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	} elseif (preg_match( '/source/', $key )) {

		if (substr($key, 0, 1) == 'W') {
			$_SESSION['sourceArray']['work'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 1) == 'I') {
			$_SESSION['sourceArray']['image'][$key] = trim($mysqli->real_escape_string($value));
		} elseif (substr($key, 0, 2) == 'NW') {
			$_SESSION['sourceArray']['createNewWork'][$key] = trim($mysqli->real_escape_string($value));
		}

	}

}

$title = $agent = $date = $material = $technique = $workType = $culturalContext = $stylePeriod = $location = $description = $stateEdition = $measurements = $subject = $inscription = $rights = $source = array();

$dataTypes = array('title','agent','date','material','technique','workType','culturalContext','stylePeriod','location','description','stateEdition','measurements','subject','inscription','rights','source');

$work = $image = $createNewWork = array();

ini_set('display_errors', '0');

foreach ($dataTypes as $dataType) {

	if (isset($_POST['json']['newWork'])
	&& $_POST['json']['newWork'] == true)
	// A new work was created, not a normal catalog update
	{
		$i = 0; $type = 'createNewWork';

		while ($i < countCatRows($_SESSION[$dataType .'Array'][$type])) {

			foreach ($_SESSION[$dataType .'Array'][$type] as $key=>$value) {

				// if (endsWith($key, $i) && !preg_match('/description/', $key)) {

					${$type}[$i][substr_replace(substr_replace($key, '', -1), '', 0, 1)] = $value;

				// }

			}
			$i ++;
		}
	}
	else
	{
		$i = 0; $type = 'work';

		while ($i < countCatRows($_SESSION[$dataType .'Array'][$type])) {

			foreach ($_SESSION[$dataType .'Array'][$type] as $key=>$value) {

				// if (endsWith($key, $i) && !preg_match('/description/', $key)) {

					${$type}[$i][substr_replace(substr_replace($key, '', -1), '', 0, 1)] = $value;

				// }

			}
			$i ++;
		}

		$i = 0; $type = 'image';

		while ($i < countCatRows($_SESSION[$dataType .'Array'][$type])) {

			foreach ($_SESSION[$dataType .'Array'][$type] as $key=>$value) {

				// if (endsWith($key, $i) && !preg_match('/description/', $key)) {

					${$type}[$i][substr_replace(substr_replace($key, '', -1), '', 0, 1)] = $value;

				// }

			}
			$i ++;
		}
	}

	${$dataType}[] = array_merge( array( 'work'=>$work ), array( 'image'=>$image ) );

	$work = $image = $createNewWork = array();

}

ini_set('display_errors', '1');

if (isset($_POST['json']['newWork'])
&& $_POST['json']['newWork'] == true)
// A new work was created, not a normal catalog update
{
	require_once('../_php/create_work_script.php');
}
else
{
	require_once('../_php/updateWork_script.php');

	require_once('../_php/updateImage_script.php');
}


text:
/**
 *
 * @author greg (at) myrobotlab.org
 *
 * This file is part of MyRobotLab (http://myrobotlab.org).
 *
 * MyRobotLab is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 2 of the License, or (at your option) any later
 * version (subject to the "Classpath" exception as provided in the LICENSE.txt
 * file that accompanied this code).
 *
 * MyRobotLab is distributed in the hope that it will be useful or fun, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * All libraries in thirdParty bundle are subject to their own license
 * requirements - please refer to http://myrobotlab.org/libraries for details.
 *
 * Enjoy !
 *
 *
 */
package org.myrobotlab.control;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Random;

import javax.swing.ImageIcon;
import javax.swing.JList;
import javax.swing.JTabbedPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

import org.myrobotlab.image.SerializableImage;
import org.myrobotlab.logging.LoggerFactory;
import org.myrobotlab.service.GUIService;
import org.myrobotlab.service.interfaces.VideoGUISource;
import org.slf4j.Logger;

public class LIDARGUI extends ServiceGUI implements ListSelectionListener, VideoGUISource {

	static final long serialVersionUID = 1L;
	public final static Logger log = LoggerFactory.getLogger(LIDARGUI.class.toString());
	VideoWidget screen = null;
	Graphics cam = null;
	Graphics graph = null;
	BufferedImage camImage = null;
	BufferedImage graphImage = null;
	int width = 1536;
	int height = 768;
	int xyScale = 2;
	ArrayList<ArrayList<Integer>> history = new ArrayList<ArrayList<Integer>>(); // A
																					// list
																					// of
																					// lists
																					// for
																					// holding
																					// old
																					// data
	public Random rand = new Random();
	int vheight = height / xyScale;
	int vwidth = width / xyScale;
	ArrayList<Integer> hist = new ArrayList<Integer>();
	boolean staticInfo = false;

	DecimalFormat df = new DecimalFormat("#.##");

	int cnt = 0;

	public LIDARGUI(final String boundServiceName, final GUIService myService, final JTabbedPane tabs) {
		super(boundServiceName, myService, tabs);
	}

	@Override
	public void attachGUI() {

		subscribe("publishLidarData", "displaySweepData", int[].class);

	}

	protected ImageIcon createImageIcon(String path, String description) {
		java.net.URL imgURL = getClass().getResource(path);
		if (imgURL != null) {
			return new ImageIcon(imgURL, description);
		} else {
			System.err.println("Couldn't find file: " + path);
			return null;
		}
	}

	@Override
	public void detachGUI() {
		unsubscribe("publishLidarData", "displaySweepData", int[].class);
	}

	public void displayFrame(SerializableImage camImage) {
		screen.displayFrame(camImage);
	}

	// TODO - check for copy/ref of parameter moved locally
	// TODO remove IREven
	// find angle
	public void displaySweepData(int[] points) {

		int[] x = new int[points.length]; // Just initializing them to the
											// correct size, values will be
											// overwritten below
		int[] y = new int[points.length];

		int zScale = 8; // 11
		int xOffset = vwidth / 2; // set origin of polar in middle

		if (points != null) {
			// blank screen
			graph.setColor(Color.black);
			graph.fillRect(0, 0, vwidth, vheight);

			// draw static parts

			// Draw Crosshairs
			graph.setColor(Color.gray);
			int midh = (vheight) / 2;
			int midw = (vwidth) / 2;
			graph.drawLine(midw - 20, vheight - 2, midw + 20, vheight - 2);
			graph.drawLine(midw, vheight, midw, vheight - 30);

			for (int i = 0; i < vheight; i += 60) {
				graph.drawLine(0, vheight - i, vwidth, vheight - i);
			}

			drawStaticInfo(); // draw arcs on the screen

			// get the first and last point
			int first = points[0];

			graph.setColor(Color.green);

			int length = points.length;

			float startingAngle = 0;
			if (length == 101 || length == 201 || length == 401) {
				startingAngle = 40;
			}
			int p;

			graph.setColor(Color.green);
			for (int i = 0; i < length; ++i) {
				// polar coordinates !
				// x = (int) ((points[i]) * Math.cos(((i * 100 / length) +
				// startingAngle) * (3.14159 / 180)) + xOffset);
				// y = vheight - (int) ((points[i]) * Math.sin(((i * 100 /
				// length) + startingAngle) * (3.14159 / 180))); //vheight
				// inverts the Y-coordinates
				x[i] = (int) ((points[i]) * Math.cos(((i * 100 / length) + startingAngle) * (3.14159 / 180)));
				y[i] = (int) ((points[i]) * Math.sin(((i * 100 / length) + startingAngle) * (3.14159 / 180))); // vheight
																												// inverts
																												// the
																												// Y-coordinates
				System.out.println(x[i] + "\t" + y[i]);
			}

			// map current value to window size. Values will be plotted so
			// largest value = 95% of the window size
			int[] xMinMax = getMinMax(x); // Get Max and Min values from the
											// array
			int[] yMinMax = getMinMax(y); // Get Max and Min values from the
											// array
			System.out.println("xMin= " + xMinMax[0] + " xmax= " + xMinMax[1] + " ymin= " + yMinMax[0] + " ymax= " + yMinMax[1]);
			for (int i = 0; i < length; ++i) {

				// scales the screen so that the values fit within 95% of the X
				// and Y values
				// x[i] = map(x[i], 100, xMax - 100, 0, (int) (vwidth *
				// 0.95))+xOffset/2 ;
				// y[i] = map(y[i], 100, yMax - 100, 0, (int) (vheight * 0.95));

				/*
				 * Scales y to 8 meters high and X to 8 meters in each direction
				 * the Max distance of a LMS200 and X to
				 */
				x[i] = map(x[i], xMinMax[0], xMinMax[1], 0, vwidth - 5);
				y[i] = vheight - map(y[i], 0, yMinMax[1], 0, vheight - 5); // the
																			// "vheight -"
																			// inverts
																			// the
																			// data
																			// for
																			// display
																			// in
																			// the
																			// window
				System.out.println(x[i] + "\t" + y[i]);

				// graph.drawLine(x[i], y[i], x[i], y[i]);//draws a dot on the
				// point
				if (i > 0) {
					graph.drawLine(x[i - 1], y[i - 1], x[i], y[i]);// draws an
																	// actual
																	// line from
																	// point to
																	// point
				}
			}

			// draw history TODO - draw history first
			/*
			 * history = (dir.compareTo(leftstr)==0)?left:right;
			 */
			int v = 180;
			for (int i = 0; i < history.size(); ++i) {
				ArrayList<Integer> sweep = history.get(i);
				graph.setColor(new Color(v, v, v));
				for (int j = sweep.size(); j > 0; j--) {
					p = sweep.get(j);
					// // x = vwidth - ((int) (p *
					// Math.cos((i*100/length)+startingAngle) * zScale));
					// // y = vheight - ((int) (p *
					// Math.sin((i*100/length)+startingAngle) * zScale));
					// x = vwidth ((int) (p *
					// Math.cos((i*100/length)+startingAngle) *
					// zScale)+xOffset);
					// y = vheight - ((int) (p *
					// Math.sin((i*100/length)+startingAngle) * zScale));
					// graph.drawLine(x, y, x, y);
				}
				v -= 30;

			}

			int maxHistory = 3;

			// history.add(WiiDAR.copy(points));
			// p = history.get(0).get(0);
			if (history.size() > maxHistory) {
				history.remove(0);
			}

			screen.displayFrame(new SerializableImage(graphImage, boundServiceName));

		} else {
			log.error("points null");
		}

	}

	public void drawStaticInfo() {
		graph.setColor(Color.gray);

		int inches = 0;

		// 10 inches per 140 inches

		int r = 160;

		for (r = 160; r < vheight * 2; r += 160) {
			inches += 10;
			graph.drawArc(vwidth / 2 - r / 2, vheight - r / 2, r, r, 0, 180);
			// graph.drawLine(0, vheight - i, vwidth, vheight - i);
			// graph.drawArc(vwidth - 40, vheight, vheight - i - 5, vheight - i
			// - 5, 0, 360);
			// graph.drawArc(vwidth - 40, vheight, 30, 30, 0, 360);
			// graph.drawArc(vwidth/2 - 100, vheight - 100, 200, 200, 0, 180);

			// Print text on the screen
			// graph.drawString("" + inches, vwidth / 2 + r / 2, vheight - 10);
		}

		staticInfo = true;
	}

	@Override
	public VideoWidget getLocalDisplay() {
		return screen;
	}

	public int getMax(int[] points) {
		int max; // Values are stored as {min, max}

		max = points[0]; // set initial values

		for (int i = 1; i < points.length; i++) { // store the highest value
			if (points[i] > max) {
				max = points[i];
			}

		}// end for all values
			// log.info("Min num = "+minMax[0]+" Max num = "+minMax[1]);
		return max;
	}

	public int[] getMinMax(int[] points) {
		int[] minMax = { 0, 0 }; // Values are stored as {min, max}

		minMax[0] = points[0]; // set initial values
		minMax[1] = points[0];

		for (int i = 1; i < points.length; i++) { // store the smallest value
			if (points[i] < minMax[0]) {
				minMax[0] = points[i];
			}
			if (points[i] > minMax[1]) { // Store the highest value
				minMax[1] = points[i];
			}
		}// end for all values
			// log.info("Min num = "+minMax[0]+" Max num = "+minMax[1]);
		return minMax;
	}

	@Override
	public void init() {
		screen = new VideoWidget(boundServiceName, myService, tabs);
		screen.init();

		camImage = new BufferedImage(width / xyScale, height / xyScale, BufferedImage.TYPE_INT_RGB);
		graphImage = new BufferedImage(width / xyScale, height / xyScale, BufferedImage.TYPE_INT_RGB);

		cam = camImage.getGraphics();
		graph = graphImage.getGraphics();

		graph.setColor(Color.green);

		screen.displayFrame(new SerializableImage(graphImage, boundServiceName));

		gc.gridx = 0;
		gc.gridy = 0;
		gc.gridheight = 4;
		gc.gridwidth = 2;
		display.add(screen.display, gc);

		gc.gridx = 2;

		gc.gridx = 0;
		gc.gridheight = 1;
		gc.gridwidth = 1;
		gc.gridy = 5;

		setCurrentFilterMouseListener();

	}

	public int map(int x, int in_min, int in_max, int out_min, int out_max) {
		// log.info("mapping "+ x+ " to a min of "+out_min +
		// " and a max of "+out_max);
		return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
	}

	// TODO - encapsulate this
	// MouseListener mouseListener = new MouseAdapter() {
	public void setCurrentFilterMouseListener() {
		MouseListener mouseListener = new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent mouseEvent) {
				JList theList = (JList) mouseEvent.getSource();
				if (mouseEvent.getClickCount() == 2) {
					int index = theList.locationToIndex(mouseEvent.getPoint());
					if (index >= 0) {
						Object o = theList.getModel().getElementAt(index);
						System.out.println("Double-clicked on: " + o.toString());
					}
				}
			}
		};

	}

	@Override
	public void valueChanged(ListSelectionEvent arg0) {
	}
}


text:
package org.apache.wss4j.policy.model;

import java.util.Iterator;
import java.util.List;

import javax.xml.namespace.QName;

import org.apache.neethi.Assertion;
import org.apache.neethi.Policy;
import org.apache.wss4j.policy.SPConstants;

public class Trust13 extends Trust10 {

    private boolean requireRequestSecurityTokenCollection;
    private boolean requireAppliesTo;
    private boolean scopePolicy15;
    private boolean mustSupportInteractiveChallenge;

    public Trust13(SPConstants.SPVersion version, Policy nestedPolicy) {
        super(version, nestedPolicy);

        parseNestedTrust13Policy(nestedPolicy, this);
    }

    @Override
    public QName getName() {
        return getVersion().getSPConstants().getTrust13();
    }

    @Override
    public boolean equals(Object object) {
        if (object == this) {
            return true;
        }
        if (!(object instanceof Trust13)) {
            return false;
        }

        Trust13 that = (Trust13)object;
        if (requireRequestSecurityTokenCollection != that.requireRequestSecurityTokenCollection
            || requireAppliesTo != that.requireAppliesTo
            || scopePolicy15 != that.scopePolicy15
            || mustSupportInteractiveChallenge != that.mustSupportInteractiveChallenge) {
            return false;
        }

        return super.equals(object);
    }

    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + Boolean.hashCode(requireRequestSecurityTokenCollection);
        result = 31 * result + Boolean.hashCode(requireAppliesTo);
        result = 31 * result + Boolean.hashCode(scopePolicy15);
        result = 31 * result + Boolean.hashCode(mustSupportInteractiveChallenge);

        return 31 * result + super.hashCode();
    }

    @Override
    protected AbstractSecurityAssertion cloneAssertion(Policy nestedPolicy) {
        return new Trust13(getVersion(), nestedPolicy);
    }

    protected void parseNestedTrust13Policy(Policy nestedPolicy, Trust13 trust13) {
        Iterator<List<Assertion>> alternatives = nestedPolicy.getAlternatives();
        //we just process the first alternative
        //this means that if we have a compact policy only the first alternative is visible
        //in contrary to a normalized policy where just one alternative exists
        if (alternatives.hasNext()) {
            List<Assertion> assertions = alternatives.next();
            for (Assertion assertion : assertions) {
                String assertionName = assertion.getName().getLocalPart();
                String assertionNamespace = assertion.getName().getNamespaceURI();

                QName requireRSTC = getVersion().getSPConstants().getRequireRequestSecurityTokenCollection();
                if (requireRSTC.getLocalPart().equals(assertionName)
                    && requireRSTC.getNamespaceURI().equals(assertionNamespace)) {
                    if (trust13.isRequireRequestSecurityTokenCollection()) {
                        throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                    }
                    trust13.setRequireRequestSecurityTokenCollection(true);
                    continue;
                }

                QName requireAppliesTo = getVersion().getSPConstants().getRequireAppliesTo();
                if (requireAppliesTo.getLocalPart().equals(assertionName)
                    && requireAppliesTo.getNamespaceURI().equals(assertionNamespace)) {
                    if (trust13.isRequireAppliesTo()) {
                        throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                    }
                    trust13.setRequireAppliesTo(true);
                    continue;
                }

                QName scopePolicy15 = getVersion().getSPConstants().getScopePolicy15();
                if (scopePolicy15.getLocalPart().equals(assertionName)
                    && scopePolicy15.getNamespaceURI().equals(assertionNamespace)) {
                    if (trust13.isScopePolicy15()) {
                        throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                    }
                    trust13.setScopePolicy15(true);
                    continue;
                }

                QName supportInteractiveChallenge =
                    getVersion().getSPConstants().getMustSupportInteractiveChallenge();
                if (supportInteractiveChallenge.getLocalPart().equals(assertionName)
                    && supportInteractiveChallenge.getNamespaceURI().equals(assertionNamespace)) {
                    if (trust13.isMustSupportInteractiveChallenge()) {
                        throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                    }
                    trust13.setMustSupportInteractiveChallenge(true);
                    continue;
                }
            }
        }
    }

    public boolean isRequireRequestSecurityTokenCollection() {
        return requireRequestSecurityTokenCollection;
    }

    protected void setRequireRequestSecurityTokenCollection(boolean requireRequestSecurityTokenCollection) {
        this.requireRequestSecurityTokenCollection = requireRequestSecurityTokenCollection;
    }

    public boolean isRequireAppliesTo() {
        return requireAppliesTo;
    }

    protected void setRequireAppliesTo(boolean requireAppliesTo) {
        this.requireAppliesTo = requireAppliesTo;
    }

    public boolean isScopePolicy15() {
        return scopePolicy15;
    }

    protected void setScopePolicy15(boolean scopePolicy15) {
        this.scopePolicy15 = scopePolicy15;
    }

    public boolean isMustSupportInteractiveChallenge() {
        return mustSupportInteractiveChallenge;
    }

    protected void setMustSupportInteractiveChallenge(boolean mustSupportInteractiveChallenge) {
        this.mustSupportInteractiveChallenge = mustSupportInteractiveChallenge;
    }
}


text:
param($installPath, $toolsPath, $package, $project)

$contentFolderItem = $project.ProjectItems.Item("Content")
$aboutFolderItem = $contentFolderItem.ProjectItems.Item("About")
$aboutStylesItem = $aboutFolderItem.ProjectItems.Item("AboutStyles.xaml")

$aboutStylesItem.Properties.Item("BuildAction").Value = [int]2


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="eu.unicate.retroauth.demo"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        <activity
            android:name="eu.unicate.retroauth.demo.MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity android:name=".auth.LoginActivity">
            <intent-filter>
                <action android:name="eu.unicate.auth.action.AUTH"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
        </activity>

        <service
            android:name=".auth.DemoLoginService"
            android:process=":auth"
            android:exported="false">
            <intent-filter>
                <action android:name="android.accounts.AccountAuthenticator"/>
            </intent-filter>
            <meta-data
                android:name="android.accounts.AccountAuthenticator"
                android:resource="@xml/authenticator"/>
        </service>
    </application>

</manifest>


text:
<?header("Content-Type: text/html; charset=" . View::$charset);?>
<!DOCTYPE html>

        <title><?if(!empty($title)) echo "{$title} — ";?>Gazville.Ru</title>

        <meta charset="<?=View::$charset?>">
        <meta name="viewport" content="width=device-width">

        <link rel="icon" href="/assets/images/logo-150x150.jpg" sizes="32x32" />
        <link rel="icon" href="/assets/images/logo.jpg" sizes="192x192" />

        <link rel="stylesheet" href="/assets/styles/style.css?<?=time()?>" />
        <link rel="stylesheet" href="/assets/styles/loading.css?<?=time()?>" />
        <link rel="stylesheet" href="/assets/styles/sidebar.css?<?=time()?>" />
        <link rel="stylesheet" href="/assets/styles/header.css?<?=time()?>" />

            Загрузка

        <?$this->placeView("sidebar.php");?>

            <div id="header"<?if(!User::isUserLoggedIn()):?> class="slice"<?endif;?>>
                ГруппаИнформацияСобытия<?if(User::isUserLoggedIn()):?>Рубрики<?endif;?>Обратная связь


text:
import { MeshPhongMaterial } from './MeshPhongMaterial';

/**
 * @author takahirox / http://github.com/takahirox
 *
 * parameters = {
 *  gradientMap: new B3D.Texture( <Image> )
 * }
 */

function MeshToonMaterial( parameters ) {

	MeshPhongMaterial.call( this );

	this.defines = { 'TOON': '' };

	this.type = 'MeshToonMaterial';

	this.gradientMap = null;

	this.setValues( parameters );

}

MeshToonMaterial.prototype = Object.create( MeshPhongMaterial.prototype );
MeshToonMaterial.prototype.constructor = MeshToonMaterial;

MeshToonMaterial.prototype.isMeshToonMaterial = true;

MeshToonMaterial.prototype.copy = function ( source ) {

	MeshPhongMaterial.prototype.copy.call( this, source );

	this.gradientMap = source.gradientMap;

	return this;

};

export { MeshToonMaterial };


text:
var l_Titre_TraitesParMoi = "A tratar por mi";
var l_Titre_ATraiter = "Formularios que deben tratarse";
var l_Titre_TraitesParMesGroupes = "A tratar por mis grupos";
var l_Titre_EmisParMoi = "Formularios emitidos por mí";
var l_Titre_MesBrouillons = "Mis borradores";
var l_Titre_MesModeles = "Mis modelos";
var l_Titre_Envoies = "Formularios recibidos";


text:
<?php

namespace AmiLabs\CryptoKit;

/**
 * Encrypting/decrypting interface.
 */
interface ICrypt{
    /**
     * Generates and returns salt.
     *
     * @return string
     */
    public function generateSalt();

    /**
     * Encrypts data.
     *
     * @param  string $data
     * @param  string $cipher
     * @param  string $password
     * @param  string $iv        A non-NULL Initialization Vector
     * @return string
     */
    public function encrypt($data, $cipher, $password, $iv = '');

    /**
     * Decrypts data.
     *
     * @param  string $data
     * @param  string $cipher
     * @param  string $password
     * @param  string $iv        A non-NULL Initialization Vector
     * @return string
     */
    public function decrypt($data, $cipher, $password, $iv = '');
}


text:
package main

import (
	"log"
	"math/rand"
)

var alpha = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"

// generates a random string of fixed size
func srand(size int) string {
	buf := make([]byte, size)
	for i := 0; i < size; i++ {
		buf[i] = alpha[rand.Intn(len(alpha))]
	}
	return string(buf)
}

// GetNewId returns random 5 character string.
// Random characters are [a-zA-Z0-9] excluding those with visible similarity = l,1,O,0.
// This gives 550 731 776 unique id's.
func GetNewId() string {
	return srand(5)
}

func info(template string, values ...interface{}) {
	log.Printf("[inkblot] "+template+"\n", values...)
}


text:
<template id="offset-parent" >

    component 'offset-parent'

        <slot></slot>

</template>


text:
class ignprocess : public QObject
{
    Q_OBJECT
public:
    explicit ignprocess(QObject *parent = 0);
    QProcess proc;

signals:
    void out(const QString& out,const QString& err);

public slots:
    void exec(const QString& cli);
    void nodeExec(const QString& cli);
    void _out();
    void nodeOut();
    void kill();
    void write(const QString &str);
    int pid();
};

#endif // IGNPROCESS_H


text:
import com.ifmo.ml.yandex.recommend.SVDRatingPredictor;

import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        try {
            SVDRatingPredictor predictor = new SVDRatingPredictor("data/train.csv", "data/validation.csv");
            predictor.learn();
            predictor.passTests("data/test-ids.csv");
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}


text:
=====================
sphinxcontrib-docbook
=====================

Sphinxcontrib-docbook extends sphinx with a builder for docbook xml output.
This package should be considered RnD and is probably not fit for any productive
This is the documentation of **sphinxcontrib-docbook**.
use.

Contents
========

.. toctree::
   :maxdepth: 2

   License <license>
   Authors <authors>
   Module Reference <_rst/modules>
   changes

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
package org.diirt.vtype;

import java.util.List;

/**
 *
 * @author carcassi
 */
class IVEnum extends IVMetadata implements VEnum {

    private final int index;
    private final List<String> labels;

    public IVEnum(int index, List<String> labels, Alarm alarm, Time time) {
        super(alarm, time);
        if (index < 0 || index >= labels.size()) {
            throw new IndexOutOfBoundsException("VEnum index must be within the label range");
        }
        this.index = index;
        this.labels = labels;
    }

    @Override
    public String getValue() {
        return labels.get(index);
    }

    @Override
    public int getIndex() {
        return index;
    }

    @Override
    public List<String> getLabels() {
        return labels;
    }

    @Override
    public String toString() {
        return VTypeToString.toString(this);
    }

}