export interface DeleteComponentResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the component build version that was deleted.

   */
  componentBuildVersionArn?: string;
}


/**
 *
You have attempted to mutate or delete a resource with a dependency that prohibits this action. See the error message for more details.

 */
export interface ResourceDependencyException extends __SmithyException, $MetadataBearer {
  name: "ResourceDependencyException";
  $fault: "client";
  message?: string;
}


export interface DeleteDistributionConfigurationRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the distribution configuration to delete. </p>
   */
  distributionConfigurationArn: string | undefined;
}


export interface DeleteDistributionConfigurationResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration that was deleted.

   */
  distributionConfigurationArn?: string;
}


export interface DeleteImageRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image to delete. </p>
   */
  imageBuildVersionArn: string | undefined;
}


export interface DeleteImageResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image that was deleted.

   */
  imageBuildVersionArn?: string;
}


export interface DeleteImagePipelineRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image pipeline to delete. </p>
   */
  imagePipelineArn: string | undefined;
}


export interface DeleteImagePipelineResponse {
  /**
   *
The Amazon Resource Name (ARN) of the image pipeline that was deleted.

   */
  imagePipelineArn?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface DeleteImageRecipeRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image recipe to delete. </p>
   */
  imageRecipeArn: string | undefined;
}


export interface DeleteImageRecipeResponse {
  /**
   *
The Amazon Resource Name (ARN) of the image recipe that was deleted.

   */
  imageRecipeArn?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface DeleteInfrastructureConfigurationRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the infrastructure configuration to delete. </p>
   */
  infrastructureConfigurationArn: string | undefined;
}


export interface DeleteInfrastructureConfigurationResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration that was deleted.

   */
  infrastructureConfigurationArn?: string;
}


/**
 *
A distribution configuration.

 */
export interface DistributionConfiguration {
  /**
   *
The description of the distribution configuration.

   */
  description?: string;

  /**
   *
The maximum duration in minutes for this distribution configuration.

   */
  timeoutMinutes: number | undefined;

  /**
   *
The name of the distribution configuration.

   */
  name?: string;

  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration.

   */
  arn?: string;

  /**
   *
The date on which this distribution configuration was last updated.

   */
  dateUpdated?: string;

  /**
   *
The tags of the distribution configuration.

   */
  tags?: { [key: string]: string };

  /**
   *
The distributions of the distribution configuration.

   */
  distributions?: Distribution[];

  /**
   *
The date on which this distribution configuration was created.

   */
  dateCreated?: string;
}


/**
 *
A high-level overview of a distribution configuration.

 */
export interface DistributionConfigurationSummary {
  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration.

   */
  arn?: string;

  /**
   *
The date on which the distribution configuration was updated.

   */
  dateUpdated?: string;

  /**
   *
The date on which the distribution configuration was created.

   */
  dateCreated?: string;

  /**
   *
The description of the distribution configuration.

   */
  description?: string;

  /**
   *
The name of the distribution configuration.

   */
  name?: string;

  /**
   *
The tags associated with the distribution configuration.

   */
  tags?: { [key: string]: string };
}


/**
 *
A filter name and value pair that is used to return a more specific list of results from a list operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

 */
export interface Filter {
  /**
   *
The name of the filter. Filter names are case-sensitive.

   */
  name?: string;

  /**
   *
The filter values. Filter values are case-sensitive.

   */
  values?: string[];
}


export interface GetComponentRequest {
  /**
   *
The Amazon Resource Name (ARN) of the component that you want to retrieve. Regex requires "/\d+$" suffix.

   */
  componentBuildVersionArn: string | undefined;
}


export interface GetComponentResponse {
  /**
   *
The component object associated with the specified ARN.

   */
  component?: Component;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface GetComponentPolicyRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the component whose policy you want to retrieve. </p>
   */
  componentArn: string | undefined;
}


export interface GetComponentPolicyResponse {
  /**
   *
The component policy.

   */
  policy?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


/**
 *
At least one of the resources referenced by your request does not exist.

 */
export interface ResourceNotFoundException extends __SmithyException, $MetadataBearer {
  name: "ResourceNotFoundException";
  $fault: "client";
  message?: string;
}


export interface GetDistributionConfigurationRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the distribution configuration that you want to retrieve. </p>
   */
  distributionConfigurationArn: string | undefined;
}


export interface GetDistributionConfigurationResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The distribution configuration object.

   */
  distributionConfiguration?: DistributionConfiguration;
}


export interface GetImageRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image that you want to retrieve. </p>
   */
  imageBuildVersionArn: string | undefined;
}


/**
 *
An image recipe.

 */
export interface ImageRecipe {
  /**
   *
The owner of the image recipe.

   */
  owner?: string;

  /**
   *
The date on which this image recipe was created.

   */
  dateCreated?: string;

  /**
   *
The block device mappings to apply when creating images from this recipe.

   */
  blockDeviceMappings?: InstanceBlockDeviceMapping[];

  /**
   *
The working directory to be used during build and test workflows.

   */
  workingDirectory?: string;

  /**
   *
The components of the image recipe.

   */
  components?: ComponentConfiguration[];

  /**
   *
The description of the image recipe.

   */
  description?: string;

  /**
   *
The name of the image recipe.

   */
  name?: string;

  /**
   *
The parent image of the image recipe.

   */
  parentImage?: string;

  /**
   *
The tags of the image recipe.

   */
  tags?: { [key: string]: string };

  /**
   *
The version of the image recipe.

   */
  version?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image recipe.

   */
  arn?: string;

  /**
   *
The platform of the image recipe.

   */
  platform?: Platform | string;
}


/**
 *
Details of the infrastructure configuration.

 */
export interface InfrastructureConfiguration {
  /**
   *
The description of the infrastructure configuration.

   */
  description?: string;

  /**
   *
The security group IDs of the infrastructure configuration.

   */
  securityGroupIds?: string[];

  /**
   *
The tags of the infrastructure configuration.

   */
  tags?: { [key: string]: string };

  /**
   *
The date on which the infrastructure configuration was last updated.

   */
  dateUpdated?: string;

  /**
   *
The terminate instance on failure configuration of the infrastructure configuration.

   */
  terminateInstanceOnFailure?: boolean;

  /**
   *
The subnet ID of the infrastructure configuration.

   */
  subnetId?: string;

  /**
   *
The instance profile of the infrastructure configuration.

   */
  instanceProfileName?: string;

  /**
   *
The EC2 key pair of the infrastructure configuration.

   */
  keyPair?: string;

  /**
   *
The name of the infrastructure configuration.

   */
  name?: string;

  /**
   *
The SNS topic Amazon Resource Name (ARN) of the infrastructure configuration.

   */
  snsTopicArn?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration.

   */
  arn?: string;

  /**
   *
The tags attached to the resource created by Image Builder.

   */
  resourceTags?: { [key: string]: string };

  /**
   *
The date on which the infrastructure configuration was created.

   */
  dateCreated?: string;

  /**
   *
The logging configuration of the infrastructure configuration.

   */
  logging?: Logging;

  /**
   *
The instance types of the infrastructure configuration.

   */
  instanceTypes?: string[];
}


/**
 *
The resources produced by this image.

 */
export interface OutputResources {
  /**
   *
The EC2 AMIs created by this image.

   */
  amis?: Ami[];
}


/**
 *
An image build version.

 */
export interface Image {
  /**
   *
The distribution configuration used when creating this image.

   */
  distributionConfiguration?: DistributionConfiguration;

  /**
   *
The name of the image pipeline that created this image.

   */
  sourcePipelineName?: string;

  /**
   *
The output resources produced when creating this image.

   */
  outputResources?: OutputResources;

  /**
   *
The Amazon Resource Name (ARN) of the image pipeline that created this image.

   */
  sourcePipelineArn?: string;

  /**
   *
The platform of the image.

   */
  platform?: Platform | string;

  /**
   *
The tags of the image.

   */
  tags?: { [key: string]: string };

  /**
   *
The semantic version of the image.

   */
  version?: string;

  /**
   *
The image tests configuration used when creating this image.

   */
  imageTestsConfiguration?: ImageTestsConfiguration;

  /**
   *
The infrastructure used when creating this image.

   */
  infrastructureConfiguration?: InfrastructureConfiguration;

  /**
   *
The image recipe used when creating the image.

   */
  imageRecipe?: ImageRecipe;

  /**
   *
The date on which this image was created.

   */
  dateCreated?: string;

  /**
   *
The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.

   */
  osVersion?: string;

  /**
   *
The state of the image.

   */
  state?: ImageState;

  /**
   *
The name of the image.

   */
  name?: string;

  /**
   *
 Collects additional information about the image being created, including the operating system (OS) version and package list. This information is used to enhance the overall experience of using EC2 Image Builder. Enabled by default.

   */
  enhancedImageMetadataEnabled?: boolean;

  /**
   *
The Amazon Resource Name (ARN) of the image.

   */
  arn?: string;
}


export interface GetImageResponse {
  /**
   *
The image object.

   */
  image?: Image;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface GetImagePipelineRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image pipeline that you want to retrieve. </p>
   */
  imagePipelineArn: string | undefined;
}


/**
 *
Details of an image pipeline.

 */
export interface ImagePipeline {
  /**
   *
The Amazon Resource Name (ARN) of the image pipeline.

   */
  arn?: string;

  /**
   *
The status of the image pipeline.

   */
  status?: PipelineStatus | string;

  /**
   *
 Collects additional information about the image being created, including the operating system (OS) version and package list. This information is used to enhance the overall experience of using EC2 Image Builder. Enabled by default.

   */
  enhancedImageMetadataEnabled?: boolean;

  /**
   *
The tags of this image pipeline.

   */
  tags?: { [key: string]: string };

  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration associated with this image pipeline.

   */
  distributionConfigurationArn?: string;

  /**
   *
The date on which this image pipeline was created.

   */
  dateCreated?: string;

  /**
   *
The schedule of the image pipeline.

   */
  schedule?: Schedule;

  /**
   *
The image tests configuration of the image pipeline.

   */
  imageTestsConfiguration?: ImageTestsConfiguration;

  /**
   *
The platform of the image pipeline.

   */
  platform?: Platform | string;

  /**
   *
The date on which this image pipeline was last updated.

   */
  dateUpdated?: string;

  /**
   *
The name of the image pipeline.

   */
  name?: string;

  /**
   *
The date on which this image pipeline will next be run.

   */
  dateNextRun?: string;

  /**
   *
The description of the image pipeline.

   */
  description?: string;

  /**
   *
The date on which this image pipeline was last run.

   */
  dateLastRun?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration associated with this image pipeline.

   */
  infrastructureConfigurationArn?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image recipe associated with this image pipeline.

   */
  imageRecipeArn?: string;
}


export interface GetImagePipelineResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The image pipeline object.

   */
  imagePipeline?: ImagePipeline;
}


export interface GetImagePolicyRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image whose policy you want to retrieve. </p>
   */
  imageArn: string | undefined;
}


export interface GetImagePolicyResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The image policy object.

   */
  policy?: string;
}


export interface GetImageRecipeRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image recipe that you want to retrieve. </p>
   */
  imageRecipeArn: string | undefined;
}


export interface GetImageRecipeResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The image recipe object.

   */
  imageRecipe?: ImageRecipe;
}


export interface GetImageRecipePolicyRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the image recipe whose policy you want to retrieve. </p>
   */
  imageRecipeArn: string | undefined;
}


export interface GetImageRecipePolicyResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The image recipe policy object.

   */
  policy?: string;
}


/**
 * <p> GetInfrastructureConfiguration request object. </p>
 */
export interface GetInfrastructureConfigurationRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the infrastructure configuration that you want to retrieve. </p>
   */
  infrastructureConfigurationArn: string | undefined;
}


/**
 *
GetInfrastructureConfiguration response object.

 */
export interface GetInfrastructureConfigurationResponse {
  /**
   *
The infrastructure configuration object.

   */
  infrastructureConfiguration?: InfrastructureConfiguration;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface ImportComponentRequest {
  /**
   *
The semantic version of the component. This version follows the semantic version syntax. For example, major.minor.patch. This could be versioned like software (2.0.1) or like a date (2019.12.01).

   */
  semanticVersion: string | undefined;

  /**
   *
 The name of the component.

   */
  name: string | undefined;

  /**
   *
The uri of the component. Must be an S3 URL and the requester must have permission to access the S3 bucket. If you use S3, you can specify component content up to your service quota. Either data or uri can be used to specify the data within the component.

   */
  uri?: string;

  /**
   *
The platform of the component.

   */
  platform: Platform | string | undefined;

  /**
   *
The type of the component denotes whether the component is used to build the image or only to test it.

   */
  type: ComponentType | string | undefined;

  /**
   *
The description of the component. Describes the contents of the component.

   */
  description?: string;

  /**
   *
The tags of the component.

   */
  tags?: { [key: string]: string };

  /**
   *
The idempotency token of the component.

   */
  clientToken?: string;

  /**
   *
The change description of the component. Describes what change has been made in this version, or what makes this version different from other versions of this component.

   */
  changeDescription?: string;

  /**
   *
The ID of the KMS key that should be used to encrypt this component.

   */
  kmsKeyId?: string;

  /**
   *
The format of the resource that you want to import as a component.

   */
  format: ComponentFormat | string | undefined;

  /**
   *
The data of the component. Used to specify the data inline. Either data or uri can be used to specify the data within the component.

   */
  data?: string;
}


export interface ImportComponentResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The Amazon Resource Name (ARN) of the imported component.

   */
  componentBuildVersionArn?: string;
}


/**
 *
You have provided an invalid pagination token in your request.

 */
export interface InvalidPaginationTokenException extends __SmithyException, $MetadataBearer {
  name: "InvalidPaginationTokenException";
  $fault: "client";
  message?: string;
}


export interface ListComponentBuildVersionsRequest {
  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;

  /**
   *
The component version Amazon Resource Name (ARN) whose versions you want to list.

   */
  componentVersionArn: string | undefined;
}


export interface ListComponentBuildVersionsResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;

  /**
   *
The list of component summaries for the specified semantic version.

   */
  componentSummaryList?: ComponentSummary[];
}


export interface ListComponentsRequest {
  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
The owner defines which components you want to list. By default, this request will only show components owned by your account. You can use this field to specify if you want to view components owned by yourself, by Amazon, or those components that have been shared with you by other customers.

   */
  owner?: Ownership | string;

  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;

  /**
   *
The filters.

   */
  filters?: Filter[];
}


export interface ListComponentsResponse {
  /**
   *
The list of component semantic versions.

   */
  componentVersionList?: ComponentVersion[];

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;
}


export interface ListDistributionConfigurationsRequest {
  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;

  /**
   *
The filters.

 name - The name of this distribution configuration.

   */
  filters?: Filter[];
}


export interface ListDistributionConfigurationsResponse {
  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;

  /**
   *
The list of distributions.

   */
  distributionConfigurationSummaryList?: DistributionConfigurationSummary[];

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface ListImageBuildVersionsRequest {
  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;

  /**
   *
The filters.

   */
  filters?: Filter[];

  /**
   *
The Amazon Resource Name (ARN) of the image whose build versions you want to retrieve.

   */
  imageVersionArn: string | undefined;

  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;
}


/**
 *
An image summary.

 */
export interface ImageSummary {
  /**
   *
The date on which this image was created.

   */
  dateCreated?: string;

  /**
   *
The output resources produced when creating this image.

   */
  outputResources?: OutputResources;

  /**
   *
The tags of the image.

   */
  tags?: { [key: string]: string };

  /**
   *
The owner of the image.

   */
  owner?: string;

  /**
   *
The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.

   */
  osVersion?: string;

  /**
   *
The version of the image.

   */
  version?: string;

  /**
   *
The platform of the image.

   */
  platform?: Platform | string;

  /**
   *
The Amazon Resource Name (ARN) of the image.

   */
  arn?: string;

  /**
   *
The name of the image.

   */
  name?: string;

  /**
   *
The state of the image.

   */
  state?: ImageState;
}


export interface ListImageBuildVersionsResponse {
  /**
   *
The list of image build versions.

   */
  imageSummaryList?: ImageSummary[];

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface ListImagePipelineImagesRequest {
  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
The Amazon Resource Name (ARN) of the image pipeline whose images you want to view.

   */
  imagePipelineArn: string | undefined;

  /**
   *
The filters.

   */
  filters?: Filter[];

  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;
}


export interface ListImagePipelineImagesResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;

  /**
   *
The list of images built by this pipeline.

   */
  imageSummaryList?: ImageSummary[];
}


export interface ListImagePipelinesRequest {
  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;

  /**
   *
The filters.

   */
  filters?: Filter[];

  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;
}


export interface ListImagePipelinesResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;

  /**
   *
The list of image pipelines.

   */
  imagePipelineList?: ImagePipeline[];
}


export interface ListImageRecipesRequest {
  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
The owner defines which image recipes you want to list. By default, this request will only show image recipes owned by your account. You can use this field to specify if you want to view image recipes owned by yourself, by Amazon, or those image recipes that have been shared with you by other customers.

   */
  owner?: Ownership | string;

  /**
   *
The filters.

   */
  filters?: Filter[];

  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;
}


/**
 *
A summary of an image recipe.

 */
export interface ImageRecipeSummary {
  /**
   *
The platform of the image recipe.

   */
  platform?: Platform | string;

  /**
   *
The tags of the image recipe.

   */
  tags?: { [key: string]: string };

  /**
   *
The name of the image recipe.

   */
  name?: string;

  /**
   *
The parent image of the image recipe.

   */
  parentImage?: string;

  /**
   *
The owner of the image recipe.

   */
  owner?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image recipe.

   */
  arn?: string;

  /**
   *
The date on which this image recipe was created.

   */
  dateCreated?: string;
}


export interface ListImageRecipesResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;

  /**
   *
The list of image pipelines.

   */
  imageRecipeSummaryList?: ImageRecipeSummary[];
}


export interface ListImagesRequest {
  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;

  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
The owner defines which images you want to list. By default, this request will only show images owned by your account. You can use this field to specify if you want to view images owned by yourself, by Amazon, or those images that have been shared with you by other customers.

   */
  owner?: Ownership | string;

  /**
   *
The filters.

   */
  filters?: Filter[];
}


/**
 *
An image semantic version.

 */
export interface ImageVersion {
  /**
   *
The platform of the image semantic version.

   */
  platform?: Platform | string;

  /**
   *
 The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server 2019.

   */
  osVersion?: string;

  /**
   *
The name of the image semantic version.

   */
  name?: string;

  /**
   *
The semantic version of the image semantic version.

   */
  version?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image semantic version.

   */
  arn?: string;

  /**
   *
The owner of the image semantic version.

   */
  owner?: string;

  /**
   *
The date at which this image semantic version was created.

   */
  dateCreated?: string;
}


export interface ListImagesResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The list of image semantic versions.

   */
  imageVersionList?: ImageVersion[];

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;
}


export interface ListInfrastructureConfigurationsRequest {
  /**
   *
The maximum items to return in a request.

   */
  maxResults?: number;

  /**
   *
The filters.

   */
  filters?: Filter[];

  /**
   *
A token to specify where to start paginating. This is the NextToken from a previously truncated response.

   */
  nextToken?: string;
}


/**
 *
The infrastructure used when building EC2 AMIs.

 */
export interface InfrastructureConfigurationSummary {
  /**
   *
The description of the infrastructure configuration.

   */
  description?: string;

  /**
   *
The tags of the infrastructure configuration.

   */
  tags?: { [key: string]: string };

  /**
   *
The date on which the infrastructure configuration was last updated.

   */
  dateUpdated?: string;

  /**
   *
The name of the infrastructure configuration.

   */
  name?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration.

   */
  arn?: string;

  /**
   *
The tags attached to the image created by Image Builder.

   */
  resourceTags?: { [key: string]: string };

  /**
   *
The date on which the infrastructure configuration was created.

   */
  dateCreated?: string;
}


export interface ListInfrastructureConfigurationsResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The list of infrastructure configurations.

   */
  infrastructureConfigurationSummaryList?: InfrastructureConfigurationSummary[];

  /**
   *
The next token used for paginated responses. When this is not empty, there are additional elements that the service has not included in this request. Use this token with the next request to retrieve additional objects.

   */
  nextToken?: string;
}


/**
 *
The specified parameter is invalid. Review the available parameters for the API request.

 */
export interface InvalidParameterException extends __SmithyException, $MetadataBearer {
  name: "InvalidParameterException";
  $fault: "client";
  message?: string;
}


export interface ListTagsForResourceRequest {
  /**
   * <p>The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve. </p>
   */
  resourceArn: string | undefined;
}


export interface ListTagsForResourceResponse {
  /**
   * <p>The tags for the specified resource. </p>
   */
  tags?: { [key: string]: string };
}


/**
 *
The value that you provided for the specified parameter is invalid.

 */
export interface InvalidParameterValueException extends __SmithyException, $MetadataBearer {
  name: "InvalidParameterValueException";
  $fault: "client";
  message?: string;
}


export interface PutComponentPolicyRequest {
  /**
   *
The policy to apply.

   */
  policy: string | undefined;

  /**
   *
The Amazon Resource Name (ARN) of the component that this policy should be applied to.

   */
  componentArn: string | undefined;
}


export interface PutComponentPolicyResponse {
  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the component that this policy was applied to.

   */
  componentArn?: string;
}


export interface PutImagePolicyRequest {
  /**
   *
The Amazon Resource Name (ARN) of the image that this policy should be applied to.

   */
  imageArn: string | undefined;

  /**
   *
The policy to apply.

   */
  policy: string | undefined;
}


export interface PutImagePolicyResponse {
  /**
   *
The Amazon Resource Name (ARN) of the image that this policy was applied to.

   */
  imageArn?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface PutImageRecipePolicyRequest {
  /**
   *
The policy to apply.

   */
  policy: string | undefined;

  /**
   *
The Amazon Resource Name (ARN) of the image recipe that this policy should be applied to.

   */
  imageRecipeArn: string | undefined;
}


export interface PutImageRecipePolicyResponse {
  /**
   *
The Amazon Resource Name (ARN) of the image recipe that this policy was applied to.

   */
  imageRecipeArn?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export interface StartImagePipelineExecutionRequest {
  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image pipeline that you want to manually invoke.

   */
  imagePipelineArn: string | undefined;
}


export interface StartImagePipelineExecutionResponse {
  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image that was created by this request.

   */
  imageBuildVersionArn?: string;
}


export interface TagResourceRequest {
  /**
   *
The Amazon Resource Name (ARN) of the resource that you want to tag.

   */
  resourceArn: string | undefined;

  /**
   *
The tags to apply to the resource.

   */
  tags: { [key: string]: string } | undefined;
}


export interface TagResourceResponse {}


export interface UntagResourceRequest {
  /**
   *
The tag keys to remove from the resource.

   */
  tagKeys: string[] | undefined;

  /**
   *
The Amazon Resource Name (ARN) of the resource that you want to untag.

   */
  resourceArn: string | undefined;
}


export interface UntagResourceResponse {}


export interface UpdateDistributionConfigurationRequest {
  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration that you want to update.

   */
  distributionConfigurationArn: string | undefined;

  /**
   *
The description of the distribution configuration.

   */
  description?: string;

  /**
   *
The distributions of the distribution configuration.

   */
  distributions: Distribution[] | undefined;

  /**
   *
The idempotency token of the distribution configuration.

   */
  clientToken?: string;
}


export interface UpdateDistributionConfigurationResponse {
  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration that was updated by this request.

   */
  distributionConfigurationArn?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;
}


export interface UpdateImagePipelineRequest {
  /**
   *
The description of the image pipeline.

   */
  description?: string;

  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The status of the image pipeline.

   */
  status?: PipelineStatus | string;

  /**
   *
The image test configuration of the image pipeline.

   */
  imageTestsConfiguration?: ImageTestsConfiguration;

  /**
   *
 Collects additional information about the image being created, including the operating system (OS) version and package list. This information is used to enhance the overall experience of using EC2 Image Builder. Enabled by default.

   */
  enhancedImageMetadataEnabled?: boolean;

  /**
   *
The Amazon Resource Name (ARN) of the distribution configuration that will be used to configure and distribute images updated by this image pipeline.

   */
  distributionConfigurationArn?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration that will be used to build images updated by this image pipeline.

   */
  infrastructureConfigurationArn: string | undefined;

  /**
   *
The Amazon Resource Name (ARN) of the image pipeline that you want to update.

   */
  imagePipelineArn: string | undefined;

  /**
   *
The schedule of the image pipeline.

   */
  schedule?: Schedule;

  /**
   *
The Amazon Resource Name (ARN) of the image recipe that will be used to configure images updated by this image pipeline.

   */
  imageRecipeArn: string | undefined;
}


export interface UpdateImagePipelineResponse {
  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;

  /**
   *
The Amazon Resource Name (ARN) of the image pipeline that was updated by this request.

   */
  imagePipelineArn?: string;
}


export interface UpdateInfrastructureConfigurationRequest {
  /**
   *
The terminate instance on failure setting of the infrastructure configuration. Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.

   */
  terminateInstanceOnFailure?: boolean;

  /**
   *
The tags attached to the resource created by Image Builder.

   */
  resourceTags?: { [key: string]: string };

  /**
   *
The subnet ID to place the instance used to customize your EC2 AMI in.

   */
  subnetId?: string;

  /**
   *
The description of the infrastructure configuration.

   */
  description?: string;

  /**
   *
The key pair of the infrastructure configuration. This can be used to log on to and debug the instance used to create your image.

   */
  keyPair?: string;

  /**
   *
The instance profile to associate with the instance used to customize your EC2 AMI.

   */
  instanceProfileName: string | undefined;

  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The logging configuration of the infrastructure configuration.

   */
  logging?: Logging;

  /**
   *
The instance types of the infrastructure configuration. You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.

   */
  instanceTypes?: string[];

  /**
   *
The SNS topic on which to send image build events.

   */
  snsTopicArn?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration that you want to update.

   */
  infrastructureConfigurationArn: string | undefined;

  /**
   *
The security group IDs to associate with the instance used to customize your EC2 AMI.

   */
  securityGroupIds?: string[];
}


export interface UpdateInfrastructureConfigurationResponse {
  /**
   *
The idempotency token used to make this request idempotent.

   */
  clientToken?: string;

  /**
   *
The Amazon Resource Name (ARN) of the infrastructure configuration that was updated by this request.

   */
  infrastructureConfigurationArn?: string;

  /**
   *
The request ID that uniquely identifies this request.

   */
  requestId?: string;
}


export enum ImageStatus {
  AVAILABLE = "AVAILABLE",
  BUILDING = "BUILDING",
  CANCELLED = "CANCELLED",
  CREATING = "CREATING",
  DELETED = "DELETED",
  DEPRECATED = "DEPRECATED",
  DISTRIBUTING = "DISTRIBUTING",
  FAILED = "FAILED",
  INTEGRATING = "INTEGRATING",
  PENDING = "PENDING",
  TESTING = "TESTING",
}


export enum Platform {
  Linux = "Linux",
  Windows = "Windows",
}


export enum ComponentType {
  BUILD = "BUILD",
  TEST = "TEST",
}


export enum ComponentFormat {
  SHELL = "SHELL",
}


export enum PipelineExecutionStartCondition {
  EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE = "EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE",
  EXPRESSION_MATCH_ONLY = "EXPRESSION_MATCH_ONLY",
}


export enum PipelineStatus {
  DISABLED = "DISABLED",
  ENABLED = "ENABLED",
}


export enum EbsVolumeType {
  gp2 = "gp2",
  io1 = "io1",
  sc1 = "sc1",
  st1 = "st1",
  standard = "standard",
}


export enum Ownership {
  Amazon = "Amazon",
  Self = "Self",
  Shared = "Shared",
}


function Layout({children}: CommonProps) {
  return <Wrapper>{children}</Wrapper>;
}


({children}: ScrollMainProps) => {
  return (
    <ScrollMain>
      <ScrollWrapper>{children}</ScrollWrapper>
    </ScrollMain>
  );
}


interface CommonProps {
  children: React.ReactNode;
}


// scroll Main
interface ScrollMainProps {
  children: React.ReactNode;
}


(id: Maybe<string>, convId: Maybe<string>) => {
	const ctx = useContext(MsgrContext)
	const intes = ctx.interactions[convId as string]
	if (!intes) {
		return undefined
	}
	return intes[id as string]
}


(contactPk: Maybe<string>) => {
	const ctx = useContext(MsgrContext)
	const conversations = ctx.conversations
	const contact = ctx.contacts[contactPk as string]
	if (!contact) {
		return undefined
	}
	return conversations[contact.conversationPublicKey as string]
}


() => {
	const ctx = useMsgrContext()
	return ctx.account
}


() => {
	const ctx = useMsgrContext()
	return ctx.client
}


(convPk: Maybe<string>) => {
	const conv = useConversation(convPk)
	return useContact(conv?.contactPublicKey)
}


(contactPk: Maybe<string>) => {
	const ctx = useMsgrContext()
	if (!contactPk) {
		return undefined
	}
	return ctx.contacts[contactPk]
}


() => {
	const ctx = useMsgrContext()
	return ctx.contacts
}


() => {
	const contacts = useContacts()
	return Object.values(contacts) as berty.messenger.v1.IContact[]
}


() => {
	const contacts = useContactList()
	return useMemo(() => contacts.filter((c) => c.state === ContactState.IncomingRequest), [contacts])
}


() => contacts.filter((c) => c.state === ContactState.IncomingRequest)


(c) => c.state === ContactState.IncomingRequest


() => {
	const contacts = useContactList()
	return useMemo(
		() =>
			contacts.filter((c) =>
				[ContactState.OutgoingRequestEnqueued, ContactState.OutgoingRequestSent].includes(c.state),
			),
		[contacts],
	)
}


() =>
			contacts.filter((c) =>
				[ContactState.OutgoingRequestEnqueued, ContactState.OutgoingRequestSent].includes(c.state),
			)


(c) =>
				[ContactState.OutgoingRequestEnqueued, ContactState.OutgoingRequestSent].includes(c.state)


(searchText: Maybe<string>) => {
	const contacts = useContactList()
	if (!searchText) {
		return []
	}
	return contacts.filter((contact) =>
		contact.displayName?.toLowerCase().includes(searchText.toLowerCase()),
	)
}


(contact) =>
		contact.displayName?.toLowerCase().includes(searchText.toLowerCase())


() => {
	const ctx = useMsgrContext()
	return Object.values(ctx.conversations) as berty.messenger.v1.IConversation[]
}


() => {
	const convs = useConversationList()
	return useMemo(
		() =>
			convs.sort(
				(a, b) =>
					pbDateToNum(b.lastUpdate || b.createdDate) - pbDateToNum(a.lastUpdate || a.createdDate),
			),
		[convs],
	)
}


() =>
			convs.sort(
				(a, b) =>
					pbDateToNum(b.lastUpdate || b.createdDate) - pbDateToNum(a.lastUpdate || a.createdDate),
			)


(a, b) =>
					pbDateToNum(b.lastUpdate || b.createdDate) - pbDateToNum(a.lastUpdate || a.createdDate)


(publicKey: Maybe<string>) => {
	const ctx = useMsgrContext()
	if (!publicKey) {
		return undefined
	}
	return ctx.conversations[publicKey]
}


(publicKey: Maybe<string>) => {
	const ctx = useMsgrContext()
	return ctx.interactions[publicKey as string] || {}
}


(publicKey: Maybe<string>) => {
	const intes = useConvInteractions(publicKey)
	return Object.values(intes) as berty.messenger.v1.IInteraction[]
}


(publicKey: Maybe<string>) => {
	const intes = useConvInteractionsList(publicKey)
	return intes.sort((a, b) => pbDateToNum(a.sentDate) - pbDateToNum(b.sentDate))
}


(a, b) => pbDateToNum(a.sentDate) - pbDateToNum(b.sentDate)


(cid: Maybe<string>, convPk: Maybe<string>) => {
	const intes = useConvInteractions(convPk)
	return intes && intes[cid as string]
}


() => {
	return useConversationList().length
}


(publicKey: Maybe<string>) => {
	const ctx = useMsgrContext()
	return ctx.members[publicKey as string] || {}
}


(publicKey: Maybe<string>) => {
	const members = useConvMembers(publicKey)
	return Object.values(members) as berty.messenger.v1.IMember[]
}


() => {
	const ctx = useMsgrContext()
	return ctx.persistentOptions || {}
}


() => {
	const ctx = useMsgrContext()
	return useCallback(() => ctx.dispatch({ type: MessengerActions.Restart }), [ctx])
}


() => ctx.dispatch({ type: MessengerActions.Restart })


() => {
	const ctx = useMsgrContext()
	return useCallback(() => ctx.dispatch({ type: MessengerActions.SetStateDeleting }), [ctx])
}


() => ctx.dispatch({ type: MessengerActions.SetStateDeleting })


() => {
	const ctx = useMsgrContext()

	return useCallback(
		(accountID) => ctx.dispatch({ type: MessengerActions.SetNextAccount, payload: accountID }),
		[ctx],
	)
}


(accountID) => ctx.dispatch({ type: MessengerActions.SetNextAccount, payload: accountID })


() => {
	const ctx = useMsgrContext()
	const prevFakeCount: number = Object.values(ctx.contacts).reduce(
		(r, c) => ((c as any).fake ? r + 1 : r),
		0,
	)
	return (length = 10) => {
		const payload = fakeContacts(length, prevFakeCount)
		ctx.dispatch({
			type: MessengerActions.AddFakeData,
			payload,
		})
	}
}


(r, c) => ((c as any).fake ? r + 1 : r)


(length = 10) => {
		const payload = fakeContacts(length, prevFakeCount)
		ctx.dispatch({
			type: MessengerActions.AddFakeData,
			payload,
		})
	}


() => {
	const ctx = useMsgrContext()
	const prevFakeCount = Object.values(ctx.conversations).reduce(
		(r, c) =>
			(c as any).fake && c?.type === messengerpb.Conversation.Type.MultiMemberType ? r + 1 : r,
		0,
	)
	return (length = 10) => {
		const payload = fakeMultiMemberConversations(length, prevFakeCount)
		ctx.dispatch({
			type: MessengerActions.AddFakeData,
			payload,
		})
	}
}


(r, c) =>
			(c as any).fake && c?.type === messengerpb.Conversation.Type.MultiMemberType ? r + 1 : r


(length = 10) => {
		const payload = fakeMultiMemberConversations(length, prevFakeCount)
		ctx.dispatch({
			type: MessengerActions.AddFakeData,
			payload,
		})
	}


() => {
	const ctx = useMsgrContext()
	const fakeConversationList = useConversationList().filter((c) => (c as any).fake === true)
	const fakeMembersListList = fakeConversationList.map((conv) =>
		Object.values(ctx.members[conv.publicKey || ''] || {}).filter((member: any) => member.fake),
	)
	console.log('fakeConvCount', fakeConversationList.length)
	const prevFakeCount: number = fakeConversationList.reduce(
		(r, fakeConv) =>
			Object.values(ctx.interactions[fakeConv.publicKey || ''] || {}).reduce(
				(r2, inte) => ((inte as any).fake ? r2 + 1 : r2),
				r,
			),
		0,
	)
	console.log('prevFakeCount', prevFakeCount)
	return (length = 10) => {
		ctx.dispatch({
			type: MessengerActions.AddFakeData,
			payload: {
				interactions: fakeMessages(
					length,
					fakeConversationList,
					fakeMembersListList,
					prevFakeCount,
				),
			},
		})
	}
}


(c) => (c as any).fake === true


(conv) =>
		Object.values(ctx.members[conv.publicKey || ''] || {}).filter((member: any) => member.fake)


(member: any) => member.fake


(r, fakeConv) =>
			Object.values(ctx.interactions[fakeConv.publicKey || ''] || {}).reduce(
				(r2, inte) => ((inte as any).fake ? r2 + 1 : r2),
				r,
			)


(r2, inte) => ((inte as any).fake ? r2 + 1 : r2)


(length = 10) => {
		ctx.dispatch({
			type: MessengerActions.AddFakeData,
			payload: {
				interactions: fakeMessages(
					length,
					fakeConversationList,
					fakeMembersListList,
					prevFakeCount,
				),
			},
		})
	}


() => {
	const ctx = useMsgrContext()
	return () =>
		ctx.dispatch({
			type: MessengerActions.DeleteFakeData,
		})
}


() =>
		ctx.dispatch({
			type: MessengerActions.DeleteFakeData,
		})


(
	convPublicKey: Maybe<string>,
	filterFunc: Maybe<SortedConvsFilter>,
) => {
	let intes = useSortedConvInteractions(convPublicKey)
	if (filterFunc) {
		intes = intes.filter(filterFunc)
	}
	if (intes.length <= 0) {
		return null
	}
	return intes[intes.length - 1]
}


() => {
	const ctx = useMsgrContext()
	return ctx.dispatch
}


(inhibitor: Maybe<NotificationsInhibitor>) => {
	const dispatch = useDispatch()
	const navigation = useNavigation()
	useMountEffect(() => {
		if (!inhibitor) {
			return
		}

		const inhibit = () =>
			dispatch({ type: MessengerActions.AddNotificationInhibitor, payload: { inhibitor } })
		const revert = () =>
			dispatch({ type: MessengerActions.RemoveNotificationInhibitor, payload: { inhibitor } })

		const unsubscribeBlur = navigation.addListener('blur', revert)
		const unsubscribeFocus = navigation.addListener('focus', inhibit)

		inhibit()

		return () => {
			unsubscribeFocus()
			unsubscribeBlur()
			revert()
		}
	})
}


() => {
		if (!inhibitor) {
			return
		}

		const inhibit = () =>
			dispatch({ type: MessengerActions.AddNotificationInhibitor, payload: { inhibitor } })
		const revert = () =>
			dispatch({ type: MessengerActions.RemoveNotificationInhibitor, payload: { inhibitor } })

		const unsubscribeBlur = navigation.addListener('blur', revert)
		const unsubscribeFocus = navigation.addListener('focus', inhibit)

		inhibit()

		return () => {
			unsubscribeFocus()
			unsubscribeBlur()
			revert()
		}
	}


() =>
			dispatch({ type: MessengerActions.AddNotificationInhibitor, payload: { inhibitor } })


() =>
			dispatch({ type: MessengerActions.RemoveNotificationInhibitor, payload: { inhibitor } })


() => {
			unsubscribeFocus()
			unsubscribeBlur()
			revert()
		}


(publicKey: Maybe<string>, timeout: Maybe<number>) => {
	// timeout is the duration (in ms) that the user must stay on the page to set messages as read
	const navigation = useNavigation()

	const ctx = useMsgrContext()

	const conv = useConversation(publicKey)
	const fake = (conv && (conv as any).fake) || false

	useEffect(() => {
		if (fake) {
			return
		}
		let timeoutID: ReturnType<typeof setTimeout> | null = null
		const handleStart = () => {
			if (timeoutID === null) {
				let t = timeout
				if (typeof t !== 'number') {
					t = 1000
				}
				timeoutID = setTimeout(() => {
					timeoutID = null
					ctx.client?.conversationOpen({ groupPk: publicKey }).catch((err) => {
						console.warn('failed to open conversation,', err)
					})
				}, t)
			}
		}
		handleStart()
		const unsubscribeFocus = navigation.addListener('focus', handleStart)
		const handleStop = () => {
			if (timeoutID !== null) {
				clearTimeout(timeoutID)
				timeoutID = null
			}
			ctx.client?.conversationClose({ groupPk: publicKey }).catch((err) => {
				console.warn('failed to close conversation,', err)
			})
		}
		const unsubscribeBlur = navigation.addListener('blur', handleStop)
		return () => {
			unsubscribeFocus()
			unsubscribeBlur()
			handleStop()
		}
	}, [ctx.client, fake, navigation, publicKey, timeout])
}


() => {
		if (fake) {
			return
		}
		let timeoutID: ReturnType<typeof setTimeout> | null = null
		const handleStart = () => {
			if (timeoutID === null) {
				let t = timeout
				if (typeof t !== 'number') {
					t = 1000
				}
				timeoutID = setTimeout(() => {
					timeoutID = null
					ctx.client?.conversationOpen({ groupPk: publicKey }).catch((err) => {
						console.warn('failed to open conversation,', err)
					})
				}, t)
			}
		}
		handleStart()
		const unsubscribeFocus = navigation.addListener('focus', handleStart)
		const handleStop = () => {
			if (timeoutID !== null) {
				clearTimeout(timeoutID)
				timeoutID = null
			}
			ctx.client?.conversationClose({ groupPk: publicKey }).catch((err) => {
				console.warn('failed to close conversation,', err)
			})
		}
		const unsubscribeBlur = navigation.addListener('blur', handleStop)
		return () => {
			unsubscribeFocus()
			unsubscribeBlur()
			handleStop()
		}
	}


() => {
			if (timeoutID === null) {
				let t = timeout
				if (typeof t !== 'number') {
					t = 1000
				}
				timeoutID = setTimeout(() => {
					timeoutID = null
					ctx.client?.conversationOpen({ groupPk: publicKey }).catch((err) => {
						console.warn('failed to open conversation,', err)
					})
				}, t)
			}
		}


() => {
					timeoutID = null
					ctx.client?.conversationOpen({ groupPk: publicKey }).catch((err) => {
						console.warn('failed to open conversation,', err)
					})
				}


(err) => {
						console.warn('failed to open conversation,', err)
					}


() => {
			if (timeoutID !== null) {
				clearTimeout(timeoutID)
				timeoutID = null
			}
			ctx.client?.conversationClose({ groupPk: publicKey }).catch((err) => {
				console.warn('failed to close conversation,', err)
			})
		}


(err) => {
				console.warn('failed to close conversation,', err)
			}


() => {
			unsubscribeFocus()
			unsubscribeBlur()
			handleStop()
		}


(effect: EffectCallback) => useEffect(effect, [])


export type Maybe<T> = T | null | undefined


export type SortedConvsFilter = Parameters<
	ReturnType<typeof useSortedConvInteractions>['filter']
>[0]


() => {
  let component: SignupSocietyComponent;
  let fixture: ComponentFixture<SignupSocietyComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ SignupSocietyComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(SignupSocietyComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
}


() => {
    TestBed.configureTestingModule({
      declarations: [ SignupSocietyComponent ]
    })
    .compileComponents();
  }


() => {
    fixture = TestBed.createComponent(SignupSocietyComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  }


(props: Props) => {
  const { type = Cell.Type.DEFAULT, data, cellPadding = Base.Padding.M, className } = props

  //create props
  const blockWrapperProps = {
    className: Classnames(
      styles[type ?? Type.DEFAULT],
      className
    ),
  }

  const toCell = (cell: Cell.Props) => {
    const cellProps = {
      ...cell,
      padding: cellPadding,
      ...cell,
    };

    return (<Cell.Element {...cellProps} />);
  }

  const toRow = (row: Row.Props) => {
    const children = row.cells ? row.cells.map(cell => toCell(cell)) : null;
    const rowProps = {
      children: children,
      ...row,
    };
    return (<Row.Element {...rowProps} />);
  }

  const toTable = (rows: Row.Props[]) => {
    return rows.map(row => toRow(row));
  }

  return (
    <Block.Element {...blockWrapperProps}>
      {toTable(data.rows)}
    </Block.Element>
  )
}


(cell: Cell.Props) => {
    const cellProps = {
      ...cell,
      padding: cellPadding,
      ...cell,
    };

    return (<Cell.Element {...cellProps} />);
  }


(row: Row.Props) => {
    const children = row.cells ? row.cells.map(cell => toCell(cell)) : null;
    const rowProps = {
      children: children,
      ...row,
    };
    return (<Row.Element {...rowProps} />);
  }


cell => toCell(cell)


(rows: Row.Props[]) => {
    return rows.map(row => toRow(row));
  }


row => toRow(row)


enum Type {
  DEFAULT = 'table',
}


enum Theme {
  DEFAULT = '',
}


type Props = {
  type?: Type,
  data: {
    rows: Row.Props[],
  },
  cellPadding?: Base.Padding,
  className?: string,
}


toTable(data


() => IngredientTypeSeafood


(ingredientTypeSeafood) => ingredientTypeSeafood.ingredientType


@Entity({ name: 'ingredient_type' })
export class IngredientType {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'name' })
  name: string;

  @OneToMany(
    () => IngredientTypeSeafood,
    (ingredientTypeSeafood) => ingredientTypeSeafood.ingredientType,
  )
  ingredientTypeSeafood: IngredientTypeSeafood[];

  @CreateDateColumn({ name: 'created_at' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt: Date;

  @Column({ name: 'deleted_at', nullable: true })
  deletedAt: Date;
}


/**
 * Adds existing resource policies to a disk. You can only add one policy
 * which will be applied to this disk for scheduling snapshot creation.
 *
 * > **Note:** This resource does not support zonal disks (`gcp.compute.Disk`). For zonal disks, please refer to the `gcp.compute.DiskResourcePolicyAttachment` resource.
 *
 * ## Example Usage
 * ### Region Disk Resource Policy Attachment Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const disk = new gcp.compute.Disk("disk", {
 *     image: "debian-cloud/debian-9",
 *     size: 50,
 *     type: "pd-ssd",
 *     zone: "us-central1-a",
 * });
 * const snapdisk = new gcp.compute.Snapshot("snapdisk", {
 *     sourceDisk: disk.name,
 *     zone: "us-central1-a",
 * });
 * const ssd = new gcp.compute.RegionDisk("ssd", {
 *     replicaZones: [
 *         "us-central1-a",
 *         "us-central1-f",
 *     ],
 *     snapshot: snapdisk.id,
 *     size: 50,
 *     type: "pd-ssd",
 *     region: "us-central1",
 * });
 * const attachment = new gcp.compute.RegionDiskResourcePolicyAttachment("attachment", {
 *     disk: ssd.name,
 *     region: "us-central1",
 * });
 * const policy = new gcp.compute.ResourcePolicy("policy", {
 *     region: "us-central1",
 *     snapshotSchedulePolicy: {
 *         schedule: {
 *             dailySchedule: {
 *                 daysInCycle: 1,
 *                 startTime: "04:00",
 *             },
 *         },
 *     },
 * });
 * const myImage = gcp.compute.getImage({
 *     family: "debian-9",
 *     project: "debian-cloud",
 * });
 * ```
 *
 * ## Import
 *
 * RegionDiskResourcePolicyAttachment can be imported using any of these accepted formats
 *
 * ```sh
 *  $ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default projects/{{project}}/regions/{{region}}/disks/{{disk}}/{{name}}
 * ```
 *
 * ```sh
 *  $ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default {{project}}/{{region}}/{{disk}}/{{name}}
 * ```
 *
 * ```sh
 *  $ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default {{region}}/{{disk}}/{{name}}
 * ```
 *
 * ```sh
 *  $ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default {{disk}}/{{name}}
 * ```
 */
export class RegionDiskResourcePolicyAttachment extends pulumi.CustomResource {
    /**
     * Get an existing RegionDiskResourcePolicyAttachment resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionDiskResourcePolicyAttachmentState, opts?: pulumi.CustomResourceOptions): RegionDiskResourcePolicyAttachment {
        return new RegionDiskResourcePolicyAttachment(name, <any>state, { ...opts, id: id });
    }

    /** @internal */
    public static readonly __pulumiType = 'gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment';

    /**
     * Returns true if the given object is an instance of RegionDiskResourcePolicyAttachment.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    public static isInstance(obj: any): obj is RegionDiskResourcePolicyAttachment {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === RegionDiskResourcePolicyAttachment.__pulumiType;
    }

    /**
     * The name of the regional disk in which the resource policies are attached to.
     */
    public readonly disk!: pulumi.Output<string>;
    /**
     * The resource policy to be attached to the disk for scheduling snapshot
     * creation. Do not specify the self link.
     */
    public readonly name!: pulumi.Output<string>;
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public readonly project!: pulumi.Output<string>;
    /**
     * A reference to the region where the disk resides.
     */
    public readonly region!: pulumi.Output<string>;

    /**
     * Create a RegionDiskResourcePolicyAttachment resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name: string, args: RegionDiskResourcePolicyAttachmentArgs, opts?: pulumi.CustomResourceOptions)
    constructor(name: string, argsOrState?: RegionDiskResourcePolicyAttachmentArgs | RegionDiskResourcePolicyAttachmentState, opts?: pulumi.CustomResourceOptions) {
        let inputs: pulumi.Inputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState as RegionDiskResourcePolicyAttachmentState | undefined;
            inputs["disk"] = state ? state.disk : undefined;
            inputs["name"] = state ? state.name : undefined;
            inputs["project"] = state ? state.project : undefined;
            inputs["region"] = state ? state.region : undefined;
        } else {
            const args = argsOrState as RegionDiskResourcePolicyAttachmentArgs | undefined;
            if ((!args || args.disk === undefined) && !opts.urn) {
                throw new Error("Missing required property 'disk'");
            }
            inputs["disk"] = args ? args.disk : undefined;
            inputs["name"] = args ? args.name : undefined;
            inputs["project"] = args ? args.project : undefined;
            inputs["region"] = args ? args.region : undefined;
        }
        if (!opts.version) {
            opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
        }
        super(RegionDiskResourcePolicyAttachment.__pulumiType, name, inputs, opts);
    }
}


/**
 * Input properties used for looking up and filtering RegionDiskResourcePolicyAttachment resources.
 */
export interface RegionDiskResourcePolicyAttachmentState {
    /**
     * The name of the regional disk in which the resource policies are attached to.
     */
    disk?: pulumi.Input<string>;
    /**
     * The resource policy to be attached to the disk for scheduling snapshot
     * creation. Do not specify the self link.
     */
    name?: pulumi.Input<string>;
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    project?: pulumi.Input<string>;
    /**
     * A reference to the region where the disk resides.
     */
    region?: pulumi.Input<string>;
}


/**
 * The set of arguments for constructing a RegionDiskResourcePolicyAttachment resource.
 */
export interface RegionDiskResourcePolicyAttachmentArgs {
    /**
     * The name of the regional disk in which the resource policies are attached to.
     */
    disk: pulumi.Input<string>;
    /**
     * The resource policy to be attached to the disk for scheduling snapshot
     * creation. Do not specify the self link.
     */
    name?: pulumi.Input<string>;
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    project?: pulumi.Input<string>;
    /**
     * A reference to the region where the disk resides.
     */
    region?: pulumi.Input<string>;
}


/**
     * Get an existing RegionDiskResourcePolicyAttachment resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionDiskResourcePolicyAttachmentState, opts?: pulumi.CustomResourceOptions): RegionDiskResourcePolicyAttachment {
        return new RegionDiskResourcePolicyAttachment(name, <any>state, { ...opts, id: id });
    }


/**
     * Returns true if the given object is an instance of RegionDiskResourcePolicyAttachment.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
public static isInstance(obj: any): obj is RegionDiskResourcePolicyAttachment {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === RegionDiskResourcePolicyAttachment.__pulumiType;
    }


function ConfirmPass() {
  ////////CHANGE STATE////////

  const [confirmPass, setconfirmPass] = useState({
    confirmPassword: ''
  })

  const handleInputChange = (event) => {
    console.log(event.target.value)
    setconfirmPass({
      ...confirmPass,
      [event.target.name]: event.target.value
    })
  }

  ////////////////HIDE/SHOW-PASS////////////////
  const [passwordShown, setPasswordShown] = useState(false)

  const togglePasswordVisiblity = () => {
    setPasswordShown(passwordShown ? false : true)
  }

  ////////////////CHANGE-ICON////////////////
  const [changeIcon, setChangeIcon] = useState(false)

  const toggleChangeIcon = () => {
    setChangeIcon(changeIcon ? false : true)
  }

  ////////////////MERGE FUNCTION IN ONCLICK////////////////
  class Pass extends React.Component {
    onClick(event) {
      togglePasswordVisiblity()
      toggleChangeIcon()
    }
  }

  return (

      <input
        type={passwordShown ? 'text' : 'password'}
        autoComplete="off"
        name="confirmPassword"
        onChange={handleInputChange}
        placeholder="* Confirmar tu Contraseña"
        className="input-compare-pass"
        id="password"
      />

  )
}


function (event) {
          togglePasswordVisiblity()
          toggleChangeIcon()
        }


(event) => {
    console.log(event.target.value)
    setconfirmPass({
      ...confirmPass,
      [event.target.name]: event.target.value
    })
  }


() => {
    setPasswordShown(passwordShown ? false : true)
  }


() => {
    setChangeIcon(changeIcon ? false : true)
  }


////////////////MERGE FUNCTION IN ONCLICK////////////////
class Pass extends React.Component {
    onClick(event) {
      togglePasswordVisiblity()
      toggleChangeIcon()
    }
  }


onClick(event) {
      togglePasswordVisiblity()
      toggleChangeIcon()
    }


() => ({
  businessLoader: new DataLoader(
    async keys => Promise.all(
      keys.map(key => Business.findOne({_id: key})),
    ),
    {cacheKeyFn: (key: any) => key.toString()},
  ),
})


async keys => Promise.all(
      keys.map(key => Business.findOne({_id: key})),
    )


key => Business.findOne({_id: key})


(key: any) => key.toString()


() => (
  <EuiText size="s">
    <FormattedMessage
      id


(resolve, reject) => {
            client.methodCall("UserSummaryRemoteManager2.getGZippedSummary", [userId], (err, data: Uint8Array) => {
                /* tslint:disable:no-null-keyword */
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: data is empty" + new Error().stack);
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            });
        }


(err, data: Uint8Array) => {
                /* tslint:disable:no-null-keyword */
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: data is empty" + new Error().stack);
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            }


(resolve, reject) => {
            client.methodCall("UserSummaryRemoteManager2.getTotalNumberOfEvents", [serializedSubscription], (err, data) => {
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: data is empty: " + new Error().stack );
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            });
        }


(err, data) => {
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: data is empty: " + new Error().stack );
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            }


(row) => {
            changedFiles.push(row.replace(/\\/g, "/"));
        }


(resolve, reject) => {
            client.methodCall("VersionControlServer.getSuitableConfigurations", [changedFiles], (err, configurationId) => {
                if (err) {
                    err = err.code === ("ENOENT" || "ENOTFOUND") ? MessageConstants.URL_NOT_REACHABLE : err;
                    Logger.logError("VersionControlServer.getSuitableConfigurations failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!configurationId) {
                    Logger.logError("VersionControlServer.getSuitableConfigurations: configurationId is unexpectedly empty " + new Error().stack);
                    return reject("Configuration ids is unexpectedly empty");
                }

                Logger.logDebug(`[RemoteBuildServer#requestConfigIds: changedFiles] was found ${configurationId.length}\n` +
                    `Suitable configuration loaded ID's: ${configurationId.join(";")}`);
                resolve(configurationId);
            });
        }


(err, configurationId) => {
                if (err) {
                    err = err.code === ("ENOENT" || "ENOTFOUND") ? MessageConstants.URL_NOT_REACHABLE : err;
                    Logger.logError("VersionControlServer.getSuitableConfigurations failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!configurationId) {
                    Logger.logError("VersionControlServer.getSuitableConfigurations: configurationId is unexpectedly empty " + new Error().stack);
                    return reject("Configuration ids is unexpectedly empty");
                }

                Logger.logDebug(`[RemoteBuildServer#requestConfigIds: changedFiles] was found ${configurationId.length}\n` +
                    `Suitable configuration loaded ID's: ${configurationId.join(";")}`);
                resolve(configurationId);
            }


(resolve, reject) => {
            client.methodCall("IDEPluginNotificator.getCurrentTimestamp", [], (err, data) => {
                if (err || !data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            });
        }


(err, data) => {
                if (err || !data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            }


(resolve, reject) => {
            client.methodCall("IDEPluginNotificator.getBuildMessages", [userId, timestamp.toString()], (err, data) => {
                if (err) {
                    Logger.logError("IDEPluginNotificator.getBuildMessages: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            });
        }


(err, data) => {
                if (err) {
                    Logger.logError("IDEPluginNotificator.getBuildMessages: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            }


(resolve, reject) => {
            client.methodCall("RemoteBuildServer2.getRelatedProjects", [suitableConfigurations], (err, buildXmlArray) => {
                if (err) {
                    Logger.logError("RemoteBuildServer2.getRelatedProjects failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!buildXmlArray) {
                    Logger.logError("RemoteBuildServer2.getRelatedBuilds: buildXmlArray is unexpectedly empty " + new Error().stack);
                    return reject("Build array is unexpectedly empty");
                }

                resolve(buildXmlArray);
            });
        }


(err, buildXmlArray) => {
                if (err) {
                    Logger.logError("RemoteBuildServer2.getRelatedProjects failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!buildXmlArray) {
                    Logger.logError("RemoteBuildServer2.getRelatedBuilds: buildXmlArray is unexpectedly empty " + new Error().stack);
                    return reject("Build array is unexpectedly empty");
                }

                resolve(buildXmlArray);
            }


@injectable()
export class RemoteBuildServer {

    private credentialsStore: CredentialsStore;
    private remoteLogin: RemoteLogin;

    constructor (@inject(TYPES.CredentialsStore) credentialsStore: CredentialsStore,
                 @inject(TYPES.RemoteLogin) remoteLogin: RemoteLogin) {
        this.credentialsStore = credentialsStore;
        this.remoteLogin = remoteLogin;
    }

    private async createAndInitClient(isSilent: boolean = false): Promise<any> {
        let credentials: Credentials;
        if (isSilent) {
            credentials = this.credentialsStore.getCredentialsSilently();
        } else {
            credentials = await this.credentialsStore.getCredentials();
        }
        if (credentials) {
            const client: any = this.remoteLogin.createClient(credentials.serverURL);
            client.setCookie(Constants.XMLRPC_SESSIONID_KEY, credentials.sessionId);
            return Promise.resolve(client);
        } else {
            throw new Error("User is logged out");
        }
    }

    private async getUserId(): Promise<any> {
        const credentials: Credentials = await this.credentialsStore.getCredentials();
        if (credentials) {
            return credentials.userId;
        } else {
            throw new Error("User is logged out");
        }
    }

    public async getGZippedSummary(isSilent: boolean = false): Promise<Uint8Array> {
        const client: any = await this.createAndInitClient(isSilent);
        const userId: string = await this.getUserId();
        return new Promise<Uint8Array>((resolve, reject) => {
            client.methodCall("UserSummaryRemoteManager2.getGZippedSummary", [userId], (err, data: Uint8Array) => {
                /* tslint:disable:no-null-keyword */
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: data is empty" + new Error().stack);
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            });
        });
    }

    /**
     * @return - number of event for existing subscriptions.
     */
    public async getTotalNumberOfEvents(serializedSubscription: string): Promise<number> {
        const client: any = await this.createAndInitClient();
        return new Promise<number>((resolve, reject) => {
            client.methodCall("UserSummaryRemoteManager2.getTotalNumberOfEvents", [serializedSubscription], (err, data) => {
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: data is empty: " + new Error().stack );
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            });
        });
    }

    /**
     * @param filesFromPatch - Changed file paths in particular format. The information is required to create request for suitableBuildConfigIds.
     * @return - array of all suitable Build Config Ids.
     */
    public async getSuitableConfigurations(filesFromPatch: string[]): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        const changedFiles: string[] = [];
        //Sometimes filePaths contain incorrect backslash symbols.
        filesFromPatch.forEach((row) => {
            changedFiles.push(row.replace(/\\/g, "/"));
        });
        Logger.logDebug(`RemoteBuildServer#requestConfigIds: changedFiles: ${changedFiles.join(";")}`);
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("VersionControlServer.getSuitableConfigurations", [changedFiles], (err, configurationId) => {
                if (err) {
                    err = err.code === ("ENOENT" || "ENOTFOUND") ? MessageConstants.URL_NOT_REACHABLE : err;
                    Logger.logError("VersionControlServer.getSuitableConfigurations failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!configurationId) {
                    Logger.logError("VersionControlServer.getSuitableConfigurations: configurationId is unexpectedly empty " + new Error().stack);
                    return reject("Configuration ids is unexpectedly empty");
                }

                Logger.logDebug(`[RemoteBuildServer#requestConfigIds: changedFiles] was found ${configurationId.length}\n` +
                    `Suitable configuration loaded ID's: ${configurationId.join(";")}`);
                resolve(configurationId);
            });
        });
    }

    public async getCurrentTimestamp(): Promise<number> {
        const client: any = await this.createAndInitClient();
        return new Promise<number>((resolve, reject) => {
            client.methodCall("IDEPluginNotificator.getCurrentTimestamp", [], (err, data) => {
                if (err || !data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            });
        });
    }

    public async getBuildMessages(timestamp: number): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        const userId: string = await this.getUserId();
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("IDEPluginNotificator.getBuildMessages", [userId, timestamp.toString()], (err, data) => {
                if (err) {
                    Logger.logError("IDEPluginNotificator.getBuildMessages: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            });
        });
    }

    /**
     * @param suitableConfigurations - array of build configurations. Extension requests all related projects to collect full information
     * about build configurations (including projectNames and buildConfigurationName). The information is required to create label for BuildConfig.
     * @return - array of buildXml
     */
    public async getRelatedBuilds(suitableConfigurations: string[]): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("RemoteBuildServer2.getRelatedProjects", [suitableConfigurations], (err, buildXmlArray) => {
                if (err) {
                    Logger.logError("RemoteBuildServer2.getRelatedProjects failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!buildXmlArray) {
                    Logger.logError("RemoteBuildServer2.getRelatedBuilds: buildXmlArray is unexpectedly empty " + new Error().stack);
                    return reject("Build array is unexpectedly empty");
                }

                resolve(buildXmlArray);
            });
        });
    }
}


private async createAndInitClient(isSilent: boolean = false): Promise<any> {
        let credentials: Credentials;
        if (isSilent) {
            credentials = this.credentialsStore.getCredentialsSilently();
        } else {
            credentials = await this.credentialsStore.getCredentials();
        }
        if (credentials) {
            const client: any = this.remoteLogin.createClient(credentials.serverURL);
            client.setCookie(Constants.XMLRPC_SESSIONID_KEY, credentials.sessionId);
            return Promise.resolve(client);
        } else {
            throw new Error("User is logged out");
        }
    }


private async getUserId(): Promise<any> {
        const credentials: Credentials = await this.credentialsStore.getCredentials();
        if (credentials) {
            return credentials.userId;
        } else {
            throw new Error("User is logged out");
        }
    }


public async getGZippedSummary(isSilent: boolean = false): Promise<Uint8Array> {
        const client: any = await this.createAndInitClient(isSilent);
        const userId: string = await this.getUserId();
        return new Promise<Uint8Array>((resolve, reject) => {
            client.methodCall("UserSummaryRemoteManager2.getGZippedSummary", [userId], (err, data: Uint8Array) => {
                /* tslint:disable:no-null-keyword */
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getGZippedSummary: data is empty" + new Error().stack);
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            });
        });
    }


/**
     * @return - number of event for existing subscriptions.
     */
public async getTotalNumberOfEvents(serializedSubscription: string): Promise<number> {
        const client: any = await this.createAndInitClient();
        return new Promise<number>((resolve, reject) => {
            client.methodCall("UserSummaryRemoteManager2.getTotalNumberOfEvents", [serializedSubscription], (err, data) => {
                if (err) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: data is empty: " + new Error().stack );
                    return reject("Received data object is unexpectedly empty");
                }

                resolve(data);
            });
        });
    }


/**
     * @param filesFromPatch - Changed file paths in particular format. The information is required to create request for suitableBuildConfigIds.
     * @return - array of all suitable Build Config Ids.
     */
public async getSuitableConfigurations(filesFromPatch: string[]): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        const changedFiles: string[] = [];
        //Sometimes filePaths contain incorrect backslash symbols.
        filesFromPatch.forEach((row) => {
            changedFiles.push(row.replace(/\\/g, "/"));
        });
        Logger.logDebug(`RemoteBuildServer#requestConfigIds: changedFiles: ${changedFiles.join(";")}`);
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("VersionControlServer.getSuitableConfigurations", [changedFiles], (err, configurationId) => {
                if (err) {
                    err = err.code === ("ENOENT" || "ENOTFOUND") ? MessageConstants.URL_NOT_REACHABLE : err;
                    Logger.logError("VersionControlServer.getSuitableConfigurations failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!configurationId) {
                    Logger.logError("VersionControlServer.getSuitableConfigurations: configurationId is unexpectedly empty " + new Error().stack);
                    return reject("Configuration ids is unexpectedly empty");
                }

                Logger.logDebug(`[RemoteBuildServer#requestConfigIds: changedFiles] was found ${configurationId.length}\n` +
                    `Suitable configuration loaded ID's: ${configurationId.join(";")}`);
                resolve(configurationId);
            });
        });
    }


public async getCurrentTimestamp(): Promise<number> {
        const client: any = await this.createAndInitClient();
        return new Promise<number>((resolve, reject) => {
            client.methodCall("IDEPluginNotificator.getCurrentTimestamp", [], (err, data) => {
                if (err || !data) {
                    Logger.logError("UserSummaryRemoteManager2.getTotalNumberOfEvents: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            });
        });
    }


public async getBuildMessages(timestamp: number): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        const userId: string = await this.getUserId();
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("IDEPluginNotificator.getBuildMessages", [userId, timestamp.toString()], (err, data) => {
                if (err) {
                    Logger.logError("IDEPluginNotificator.getBuildMessages: return an error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                }

                resolve(data);
            });
        });
    }


/**
     * @param suitableConfigurations - array of build configurations. Extension requests all related projects to collect full information
     * about build configurations (including projectNames and buildConfigurationName). The information is required to create label for BuildConfig.
     * @return - array of buildXml
     */
public async getRelatedBuilds(suitableConfigurations: string[]): Promise<string[]> {
        const client: any = await this.createAndInitClient();
        return new Promise<string[]>((resolve, reject) => {
            client.methodCall("RemoteBuildServer2.getRelatedProjects", [suitableConfigurations], (err, buildXmlArray) => {
                if (err) {
                    Logger.logError("RemoteBuildServer2.getRelatedProjects failed with error: " + Utils.formatErrorMessage(err));
                    return reject(err);
                } else if (!buildXmlArray) {
                    Logger.logError("RemoteBuildServer2.getRelatedBuilds: buildXmlArray is unexpectedly empty " + new Error().stack);
                    return reject("Build array is unexpectedly empty");
                }

                resolve(buildXmlArray);
            });
        });
    }


export default class ChartProps<FormDataType extends CamelCaseFormData | SnakeCaseFormData = CamelCaseFormData> {
    static createSelector: () => ChartPropsSelector;
    annotationData: AnnotationData;
    datasource: CamelCaseDatasource;
    rawDatasource: SnakeCaseDatasource;
    initialValues: InitialValues;
    formData: CamelCaseFormData;
    rawFormData: SnakeCaseFormData | CamelCaseFormData;
    height: number;
    hooks: Hooks;
    queryData: QueryData;
    width: number;
    constructor(config?: ChartPropsConfig);
}


/**
 * Preferred format for ChartProps config
 */
export interface ChartPropsConfig {
    annotationData?: AnnotationData;
    /** Datasource metadata */
    datasource?: SnakeCaseDatasource;
    /**
     * Formerly called "filters", which was misleading because it is actually
     * initial values of the filter_box and table vis
     */
    initialValues?: InitialValues;
    /** Main configuration of the chart */
    formData?: SnakeCaseFormData;
    /** Chart height */
    height?: number;
    /** Programmatic overrides such as event handlers, renderers */
    hooks?: Hooks;
    /** Formerly called "payload" */
    queryData?: QueryData;
    /** Chart width */
    width?: number;
}


declare type AnnotationData = PlainObject;


declare type CamelCaseDatasource = PlainObject;


declare type SnakeCaseDatasource = PlainObject;


declare type CamelCaseFormData = PlainObject;


declare type SnakeCaseFormData = PlainObject;


export declare type QueryData = PlainObject;


/** Initial values for the visualizations, currently used by only filter_box and table */
declare type InitialValues = PlainObject;


declare type ChartPropsSelector = (c: ChartPropsConfig) => ChartProps;


/** Optional field for event handlers, renderers */
declare type Hooks = {
    /** handle adding filters  */
    onAddFilter?: HandlerFunction;
    /** handle errors  */
    onError?: HandlerFunction;
    /** use the vis as control to update state */
    setControlValue?: HandlerFunction;
    /** handle tooltip */
    setTooltip?: HandlerFunction;
    [key: string]: any;
};


/* eslint-disable camelcase */
export type SubredditType = {
  id: number;
  name: string;
  commentNum: string;
};


export type DataType = {
  data: {
    score: number;
    title: string;
    permalink: string;
    created_utc: number;
    author: string;
    subreddit: string;
    num_comments: number;
    id: string;
    parent_id: string;
    children: string[];
    count: number;
    body_html: string;
    likes: boolean;
    name: string;
    replies: {
      kind: string;
      data: {
        children: DataType[];
      };
    };
  };
  kind: string;
  length: number;
};


export default function HeaderContainer({
  mode,
  scenes,
  layout,
  insets,
  state,
  getPreviousRoute,
  onContentHeightChange,
  gestureDirection,
  styleInterpolator,
  style,
}: Props) {
  const focusedRoute = state.routes[state.index];

  return (
    <View pointerEvents="box-none" style={style}>
      {scenes.slice(-3).map((scene, i, self) => {
        if ((mode === 'screen' && i !== self.length - 1) || !scene) {
          return null;
        }

        const { options } = scene.descriptor;
        const isFocused = focusedRoute.key === scene.route.key;
        const previousRoute = getPreviousRoute({ route: scene.route });

        let previous;

        if (previousRoute) {
          // The previous scene will be shortly before the current scene in the array
          // So loop back from current index to avoid looping over the full array
          for (let j = i - 1; j >= 0; j--) {
            const s = self[j];

            if (s && s.route.key === previousRoute.key) {
              previous = s;
              break;
            }
          }
        }

        // If the screen is next to a headerless screen, we need to make the header appear static
        // This makes the header look like it's moving with the screen
        const previousScene = self[i - 1];
        const nextScene = self[i + 1];
        const isHeaderStatic =
          (previousScene &&
            previousScene.descriptor.options.headerShown === false &&
            // We still need to animate when coming back from next scene
            // A hacky way to check this is if the next scene exists
            !nextScene) ||
          (nextScene && nextScene.descriptor.options.headerShown === false);

        const props = {
          mode,
          layout,
          insets,
          scene,
          previous,
          navigation: scene.descriptor.navigation as StackNavigationProp<
            ParamListBase
          >,
          styleInterpolator:
            mode === 'float'
              ? isHeaderStatic
                ? gestureDirection === 'vertical' ||
                  gestureDirection === 'vertical-inverted'
                  ? forSlideUp
                  : forSlideLeft
                : styleInterpolator
              : forNoAnimation,
        };

        return (
          <NavigationContext.Provider
            key={scene.route.key}
            value={scene.descriptor.navigation}
          >
            <View
              onLayout={
                onContentHeightChange
                  ? e =>
                      onContentHeightChange({
                        route: scene.route,
                        height: e.nativeEvent.layout.height,
                      })
                  : undefined
              }
              pointerEvents={isFocused ? 'box-none' : 'none'}
              accessibilityElementsHidden={!isFocused}
              importantForAccessibility={
                isFocused ? 'auto' : 'no-hide-descendants'
              }
              style={
                mode === 'float' || options.headerTransparent
                  ? styles.header
                  : null
              }
            >
              {options.headerShown !== false ? (
                options.header !== undefined ? (
                  options.header(props)
                ) : (
                  <Header {...props} />
                )
              ) : null}
            </View>
          </NavigationContext.Provider>
        );
      }


(scene, i, self) => {
        if ((mode === 'screen' && i !== self.length - 1) || !scene) {
          return null;
        }

        const { options } = scene.descriptor;
        const isFocused = focusedRoute.key === scene.route.key;
        const previousRoute = getPreviousRoute({ route: scene.route });

        let previous;

        if (previousRoute) {
          // The previous scene will be shortly before the current scene in the array
          // So loop back from current index to avoid looping over the full array
          for (let j = i - 1; j >= 0; j--) {
            const s = self[j];

            if (s && s.route.key === previousRoute.key) {
              previous = s;
              break;
            }
          }
        }

        // If the screen is next to a headerless screen, we need to make the header appear static
        // This makes the header look like it's moving with the screen
        const previousScene = self[i - 1];
        const nextScene = self[i + 1];
        const isHeaderStatic =
          (previousScene &&
            previousScene.descriptor.options.headerShown === false &&
            // We still need to animate when coming back from next scene
            // A hacky way to check this is if the next scene exists
            !nextScene) ||
          (nextScene && nextScene.descriptor.options.headerShown === false);

        const props = {
          mode,
          layout,
          insets,
          scene,
          previous,
          navigation: scene.descriptor.navigation as StackNavigationProp<
            ParamListBase
          >,
          styleInterpolator:
            mode === 'float'
              ? isHeaderStatic
                ? gestureDirection === 'vertical' ||
                  gestureDirection === 'vertical-inverted'
                  ? forSlideUp
                  : forSlideLeft
                : styleInterpolator
              : forNoAnimation,
        };

        return (
          <NavigationContext.Provider
            key={scene.route.key}
            value={scene.descriptor.navigation}
          >
            <View
              onLayout={
                onContentHeightChange
                  ? e =>
                      onContentHeightChange({
                        route: scene.route,
                        height: e.nativeEvent.layout.height,
                      })
                  : undefined
              }
              pointerEvents={isFocused ? 'box-none' : 'none'}
              accessibilityElementsHidden={!isFocused}


e =>
                      onContentHeightChange({
                        route: scene.route,
                        height: e.nativeEvent.layout.height,
                      })


export type Props = {
  mode: 'float' | 'screen';
  layout: Layout;
  insets: EdgeInsets;
  scenes: (Scene<Route<string>> | undefined)[];
  state: StackNavigationState;
  getPreviousRoute: (props: {
    route: Route<string>;
  }) => Route<string> | undefined;
  onContentHeightChange?: (props: {
    route: Route<string>;
    height: number;
  }) => void;
  styleInterpolator: StackHeaderStyleInterpolator;
  gestureDirection: GestureDirection;
  style?: StyleProp<ViewStyle>;
};