Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional_transaction_information does not exist on Event object #133

Open
1 of 2 tasks
Tieno opened this issue Feb 18, 2020 · 1 comment
Open
1 of 2 tasks

additional_transaction_information does not exist on Event object #133

Tieno opened this issue Feb 18, 2020 · 1 comment

Comments

@Tieno
Copy link

Tieno commented Feb 18, 2020

Steps to reproduce:

  1. use SDK
  2. retrieve events via Event.List()

What should happen:

  1. Have access to additional_transaction_information
    image

What happens:

  1. Property does not exist on
    BunqSdk/Model/Generated/Endpoint/Event.cs

SDK version and environment

  • Tested on 0.12.4
  • Sandbox
  • Production

It's also not documented @ https://doc.bunq.com/#/event/List_all_Event_for_User

image

@Tieno
Copy link
Author

Tieno commented Feb 18, 2020

here's a quick and dirty fix(up)

public class EventFixup : Event
{
[JsonProperty(PropertyName = "additional_transaction_information")]
public AdditionalTransactionInformationDto AdditionalTransactionInformation { get; set; }
public static BunqResponse<List> List(IDictionary<string, string> urlParams = null,
IDictionary<string, string> customHeaders = null)
{
if (urlParams == null) urlParams = new Dictionary<string, string>();
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

        var apiClient = new ApiClient(GetApiContext());
        var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams,
            customHeaders);

        return FromJsonList<EventFixup>(responseRaw, "Event");
    }

    public static BunqResponse<EventFixup> Get(int eventId, IDictionary<string, string> customHeaders = null)
    {
        if (customHeaders == null) customHeaders = new Dictionary<string, string>();

        var apiClient = new ApiClient(GetApiContext());
        var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), eventId),
            new Dictionary<string, string>(), customHeaders);

        return FromJson<EventFixup>(responseRaw, "Event");
    }

    public partial class AdditionalTransactionInformationDto
    {
        [JsonProperty("category")]
        public string Category { get; set; }

        [JsonProperty("category_translated")]
        public string CategoryTranslated { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("email")]
        public string Email { get; set; }

        [JsonProperty("phone_number")]
        public string PhoneNumber { get; set; }

        [JsonProperty("url")]
        public Uri Url { get; set; }

        [JsonProperty("geolocation")]
        public Geolocation Geolocation { get; set; }

        [JsonProperty("avatar")]
        public Avatar Avatar { get; set; }

        [JsonProperty("address")]
        public Address Address { get; set; }

        [JsonProperty("hash_counterparty")]
        public string HashCounterparty { get; set; }
    }

    public partial class Address
    {
        [JsonProperty("street")]
        public string Street { get; set; }

        [JsonProperty("house_number")]
        public string HouseNumber { get; set; }

        [JsonProperty("postal_code")]
        public string PostalCode { get; set; }

        [JsonProperty("city")]
        public string City { get; set; }

        [JsonProperty("country")]
        public string Country { get; set; }

        [JsonProperty("province")]
        public string Province { get; set; }

        [JsonProperty("extra")]
        public string Extra { get; set; }

        [JsonProperty("mailbox_name")]
        public string MailboxName { get; set; }
    }

    public partial class Avatar
    {
        [JsonProperty("uuid")]
        public Guid Uuid { get; set; }

        [JsonProperty("image")]
        public List<Image> Image { get; set; }

        [JsonProperty("anchor_uuid")]
        public object AnchorUuid { get; set; }
    }

    public partial class Image
    {
        [JsonProperty("attachment_public_uuid")]
        public Guid AttachmentPublicUuid { get; set; }

        [JsonProperty("height")]
        public long Height { get; set; }

        [JsonProperty("width")]
        public long Width { get; set; }

        [JsonProperty("content_type")]
        public string ContentType { get; set; }
    }

    public partial class Geolocation
    {
        [JsonProperty("latitude")]
        public decimal Latitude { get; set; }

        [JsonProperty("longitude")]
        public decimal Longitude { get; set; }

        [JsonProperty("altitude")]
        public decimal Altitude { get; set; }

        [JsonProperty("radius")]
        public decimal Radius { get; set; }
    }
}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant