<commit_before>package com.gocardless.resources;

import java.util.Map;

import com.google.gson.annotations.SerializedName;

/**
 * Represents a event resource returned from the API.
 *
 * Events are stored for all webhooks. An event refers to a resource which has been updated, for
 * example a payment which has been collected, or a mandate which has been transferred.
 */
public class Event {
    private Event() {
        // blank to prevent instantiation
    }

    private String action;
    private String createdAt;
    private Details details;
    private String id;
    private Links links;
    private Map<String, String> metadata;
    private ResourceType resourceType;

    /**
     * What has happened to the resource.
     */
    public String getAction() {
        return action;
    }

    /**
     * Fixed [timestamp](https://developer.gocardless.com/pro/2015-04-29/#overview-time-zones-dates),
     * recording when this resource was created.
     */
    public String getCreatedAt() {
        return createdAt;
    }

    public Details getDetails() {
        return details;
    }

    /**
     * Unique identifier, beginning with "EV"
     */
    public String getId() {
        return id;
    }

    public Links getLinks() {
        return links;
    }

    /**
     * If the `details[origin]` is `api`, this will contain any metadata you specified when triggering
     * this event. In other cases it will be an empty object.
     */
    public Map<String, String> getMetadata() {
        return metadata;
    }

    /**
     * The resource type for this event. One of:
     * <ul>
     * <li>`payments`</li>
     * <li>`mandates`</li>
     *
     * <li>`payouts`</li>
     * <li>`refunds`</li>
     * <li>`subscriptions`</li>
     * </ul>
     */
    public ResourceType getResourceType() {
        return resourceType;
    }

    public enum ResourceType {
        @SerializedName("payments")
        PAYMENTS, @SerializedName("mandates")
        MANDATES, @SerializedName("payouts")
        PAYOUTS, @SerializedName("refunds")
        REFUNDS, @SerializedName("subscriptions")
        SUBSCRIPTIONS,
    }

    public static class Details {
        private Details() {
            // blank to prevent instantiation
        }

        private String cause;
        private String description;
        private Origin origin;
        private String reasonCode;
        private Scheme scheme;

        /**
         * What triggered the event.
         */
        public String getCause() {
            return cause;
        }

        /**
         * Human readable description of the cause. _Note:_ Changes to event descriptions are not considered
         * breaking, so your integration should not parse these messages, using `details[cause]` and/or
         * `details[reason_code]` instead.
         */
        public String getDescription() {
            return description;
        }

        /**
         * Who initiated the event. One of:
         * <ul>
         * <li>`bank`: this event was triggered by a report from
         * the banks</li>
         * <li>`gocardless`: this event was performed by GoCardless automatically</li>
         *<commit_msg>Crankshaft Build #BU0000012NW3ZD @ 2015-06-19 20:52:43 +0000<commit_after>package com.gocardless.resources;

import java.util.Map;

import com.google.gson.annotations.SerializedName;

/**
 * Represents a event resource returned from the API.
 *
 * Events are stored for all webhooks. An event refers to a resource which has been updated, for
 * example a payment which has been collected, or a mandate which has been transferred.
 */
public class Event {
    private Event() {
        // blank to prevent instantiation
    }

    private String action;
    private String createdAt;
    private Details details;
    private String id;
    private Links links;
    private Map<String, String> metadata;
    private ResourceType resourceType;

    /**
     * What has happened to the resource.
     */
    public String getAction() {
        return action;
    }

    /**
     * Fixed [timestamp](https://developer.gocardless.com/pro/2015-04-29/#overview-time-zones-dates),
     * recording when this resource was created.
     */
    public String getCreatedAt() {
        return createdAt;
    }

    public Details getDetails() {
        return details;
    }

    /**
     * Unique identifier, beginning with "EV"
     */
    public String getId() {
        return id;
    }

    public Links getLinks() {
        return links;
    }

    /**
     * If the `details[origin]` is `api`, this will contain any metadata you specified when triggering
     * this event. In other cases it will be an empty object.
     */
    public Map<String, String> getMetadata() {
        return metadata;
    }

    /**
     * The resource type for this event. One of:
     * <ul>
     * <li>`payments`</li>
     * <li>`mandates`</li>
     *
     * <li>`payouts`</li>
     * <li>`refunds`</li>
     * <li>`subscriptions`</li>
     * </ul>
     */
    public ResourceType getResourceType() {
        return resourceType;
    }

    public enum ResourceType {
        @SerializedName("payments")
        PAYMENTS, @SerializedName("mandates")
        MANDATES, @SerializedName("payouts")
        PAYOUTS, @SerializedName("refunds")
        REFUNDS, @SerializedName("subscriptions")
        SUBSCRIPTIONS,
    }

    public static class Details {
        private Details() {
            // blank to prevent instantiation
        }

        private String cause;
        private String description;
        private Origin origin;
        private String reasonCode;
        private Scheme scheme;

        /**
         * What triggered the event.
         */
        public String getCause() {
            return cause;
        }

        /**
         * Human readable description of the cause. _Note:_ Changes to event descriptions are not considered
         * breaking.
         */
        public String getDescription() {
            return description;
        }

        /**
         * Who initiated the event. One of:
         * <ul>
         * <li>`bank`: this event was triggered by a report from
         * the banks</li>
         * <li>`gocardless`: this event was performed by GoCardless automatically</li>
         *
{'fraction_non_alphanumeric': 0.0976965845909452, 'fraction_numerical': 0.006671961874503574, 'mean_word_length': 2.0908198330878744, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1881988', 'n_tokens_mistral': 1776, 'n_tokens_neox': 1667, 'n_words': 546}