Skip to content

Conversation

@matsk-sinch
Copy link
Contributor

No description provided.

description="Integer representing the total amount of the transaction.",
)
order: PaymentOrderInternal = Field(..., description="The payment order.")
payment_settings: Optional[PaymentSettingsInternal] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may change: PaymentSettingsInternal may not be a oneOf anymore and should support a data structure such as

                        "payment_settings": {
                            "dynamic_pix": {
                                "code": "1234",
                                "merchant_name": "Test merchant",
                                "key": "asdf@example.com",
                                "key_type": "EMAIL"
                            },
                            "payment_link": {
                                "uri": "https://www.example.com/payment_link"
                            }
                        },

Check MR https://gitlab.com/sinch/sinch-projects/enterprise-and-messaging/documentation/developer-experience/oas-documentation/-/merge_requests/521/diffs#e8e382f867c6543f76cefa09122b39e962ba074b for details

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Removed the Union, and implemented a Pydantic class with the 3 payment options.

def build_url(self, sinch) -> str:
if not self.ENDPOINT_URL:
raise NotImplementedError(
"ENDPOINT_URL must be defined in the subclass."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the error message will contains information about Conversation domain raising the issue ?

Without more context "ENDPOINT_URL must be defined in the subclass" won't help user to locate what is wrong/how to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added info in the message

# For Union types, try to validate against each type in the Union sequentially
# This handles cases where TypeAdapter might not be fully defined
union_args = get_args(response_model)
last_error = None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this variable is not used (last_error)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the missing implementation

Comment on lines 29 to 30
AppMessageConversationMessageInternal,
ContactMessageConversationMessageInternal,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of public model name contains the Internal suffix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Models renamed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, due to API complexity, it could be useful to triage the classes into dedicated directories (vs flatten all files in same one)

It will simplify namespace ease of use/access

e.g: https://github.com/sinch/sinch-sdk-java/tree/feat/V2.0-next/openapi-contracts/src/main/com/sinch/sdk/domains/conversation/models/v1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still pending. I’ve completed the refactor of messages/shared. The next step is refactoring messages/response/shared, which we can discuss tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Created a directory categories/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to place it under core. I will address in this ticket with proper unit tests

:param messages_source: Specifies the message source for which the request will be processed. Used for
operations on messages in Dispatch Mode. For more information,
see [Processing Modes](https://developers.sinch.com/docs/conversation/processing-modes/).
(optional)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, comment should reflect the default value in use when not set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

...,
description="The title is shown close to the button that leads to open a user calendar.",
)
event_start: StrictStr = Field(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime in place of string ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

event_start: StrictStr = Field(
..., description="The timestamp defines start of a calendar event."
)
event_end: StrictStr = Field(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetimein place of string ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

default=None,
description="Unique ID of the Facebook catalog being used by the business.",
)
expiration_time: Optional[StrictStr] = Field(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime in place of string ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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

Successfully merging this pull request may close these issues.

4 participants