diff --git a/LineSDK/LineSDK/Messaging/Model/Actions/MessageAction.swift b/LineSDK/LineSDK/Messaging/Model/Actions/MessageAction.swift index 853f5ada..4e532720 100644 --- a/LineSDK/LineSDK/Messaging/Model/Actions/MessageAction.swift +++ b/LineSDK/LineSDK/Messaging/Model/Actions/MessageAction.swift @@ -71,7 +71,7 @@ public enum MessageAction: Codable, MessageActionConvertible { } public struct MessageURIAction: Codable, TemplateMessageActionTypeCompatible, MessageActionConvertible { - let type = MessageActionType.URI + private(set) var type = MessageActionType.URI public let label: String? public let uri: URL diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexBoxComponent.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexBoxComponent.swift index 5555ea2a..7e35916e 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexBoxComponent.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexBoxComponent.swift @@ -24,7 +24,7 @@ /// A box component behave as a container of other components. It defines the layout of its child components. /// You can also include a nested box in a box. public struct FlexBoxComponent: Codable, FlexMessageComponentTypeCompatible, MessageActionContainer { - let type: FlexMessageComponentType = .box + private(set) var type: FlexMessageComponentType = .box /// The placement style of components in this box. public let layout: FlexMessageComponent.Layout diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexButtonComponent.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexButtonComponent.swift index 57473591..10175a37 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexButtonComponent.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexButtonComponent.swift @@ -45,7 +45,7 @@ public struct FlexButtonComponent: Codable, FlexMessageComponentTypeCompatible { public static let defaultCase: FlexButtonComponent.Style = .link } - let type = FlexMessageComponentType.button + private(set) var type = FlexMessageComponentType.button /// An action to perform when the button tapped. /// Use `setAction` method if you want to set a `MessageActionConvertible` as the action of current component. diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexFillerComponent.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexFillerComponent.swift index ca7ef5b5..a1446686 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexFillerComponent.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexFillerComponent.swift @@ -23,7 +23,7 @@ /// Represents an invisible component to fill extra space between components. /// The filler's `flex` is fixed to 1. The `spacing` property of the parent box will be ignored for fillers. public struct FlexFillerComponent: Codable, FlexMessageComponentTypeCompatible { - let type: FlexMessageComponentType = .filler + private(set) var type: FlexMessageComponentType = .filler /// Creates a filler component. public init() {} diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexIconComponent.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexIconComponent.swift index 2714a640..9aa3399e 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexIconComponent.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexIconComponent.swift @@ -24,7 +24,7 @@ import Foundation /// LINE internal use only. /// Represents an icon component. It is used to embed into a baseline layout and its flex is fixed to 0. public struct FlexIconComponent: Codable, FlexMessageComponentTypeCompatible { - let type: FlexMessageComponentType = .icon + private(set) var type: FlexMessageComponentType = .icon /// Icon URL. It should start with "https". public let url: URL diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSeparatorComponent.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSeparatorComponent.swift index 833f7154..b8b3a98a 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSeparatorComponent.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSeparatorComponent.swift @@ -24,7 +24,7 @@ /// Different from the `separator` property of `FlexBlockStyle`, the `FlexSeparatorComponent` allows you to add a /// separator between components instead of container block, as well as full control on separator `margin`. public struct FlexSeparatorComponent: Codable, FlexMessageComponentTypeCompatible { - let type: FlexMessageComponentType = .separator + private(set) var type: FlexMessageComponentType = .separator /// Minimum space between this component and the previous component in the parent box. /// If not specified, the `spacing` of parent box will be used. diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSpacerComponent.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSpacerComponent.swift index 1c2629ee..6eac6a9f 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSpacerComponent.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Component/FlexSpacerComponent.swift @@ -23,7 +23,7 @@ /// Represents some spacing in a box component. /// This is an invisible component that places a fixed-size space at the beginning or end of the box. public struct FlexSpacerComponent: Codable, FlexMessageComponentTypeCompatible { - let type: FlexMessageComponentType = .spacer + private(set) var type: FlexMessageComponentType = .spacer /// Size of the space. /// You can specify one from: `[.xs, .sm, .md, .lg, .xl, .xxl]`. diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexBubbleContainer.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexBubbleContainer.swift index b575a10d..183e0b21 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexBubbleContainer.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexBubbleContainer.swift @@ -61,7 +61,7 @@ public struct FlexBubbleContainer: Codable, FlexMessageContainerTypeCompatible { public static let defaultCase: Direction = .leftToRight } - let type = FlexMessageContainerType.bubble + private(set) var type = FlexMessageContainerType.bubble /// The header block. Header section of the bubble. This block is a `FlexBoxComponent` and could contains /// arbitrary nested components. diff --git a/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexCarouselContainer.swift b/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexCarouselContainer.swift index 748b5555..b509b7ce 100644 --- a/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexCarouselContainer.swift +++ b/LineSDK/LineSDK/Messaging/Model/Flex/Container/FlexCarouselContainer.swift @@ -24,7 +24,7 @@ /// scrolling horizontally. /// public struct FlexCarouselContainer: Codable, FlexMessageContainerTypeCompatible { - let type = FlexMessageContainerType.carousel + private(set) var type = FlexMessageContainerType.carousel /// Array of `FlexBubbleContainer`s. You could set at most 10 bubble container in this carousel container. /// Line SDK does not check the elements count in a container. However, it would cause an API response error diff --git a/LineSDK/LineSDK/Messaging/Model/FlexMessage.swift b/LineSDK/LineSDK/Messaging/Model/FlexMessage.swift index 33017a0d..28ca4e89 100644 --- a/LineSDK/LineSDK/Messaging/Model/FlexMessage.swift +++ b/LineSDK/LineSDK/Messaging/Model/FlexMessage.swift @@ -29,7 +29,7 @@ /// /// For more information, see https://developers.line.biz/en/docs/messaging-api/message-types/#flex-messages . public struct FlexMessage: Codable, MessageTypeCompatible { - let type = MessageType.flex + private(set) var type = MessageType.flex /// An alternate text to show in LINE push notification or chat preview. public var altText: String diff --git a/LineSDK/LineSDK/Messaging/Model/LocationMessage.swift b/LineSDK/LineSDK/Messaging/Model/LocationMessage.swift index dcbf5fe5..0e8aec81 100644 --- a/LineSDK/LineSDK/Messaging/Model/LocationMessage.swift +++ b/LineSDK/LineSDK/Messaging/Model/LocationMessage.swift @@ -26,7 +26,7 @@ public struct LocationMessage: Codable, MessageTypeCompatible { /// Represents a location latitude or longitude degrees. public typealias LocationDegrees = Double - let type = MessageType.location + private(set) var type = MessageType.location /// Title name of the location. public var title: String diff --git a/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateConfirmPayload.swift b/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateConfirmPayload.swift index da20acb8..0dc2d439 100644 --- a/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateConfirmPayload.swift +++ b/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateConfirmPayload.swift @@ -23,7 +23,7 @@ /// Represents a template payload with a text and two action button. /// Use this template if you want users to answer between "Yes" or "No". public struct TemplateConfirmPayload: Codable, TemplateMessagePayloadTypeCompatible { - let type = TemplateMessagePayloadType.confirm + private(set) var type = TemplateMessagePayloadType.confirm /// Message text in the chat bubble. public var text: String diff --git a/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateImageCarouselPayload.swift b/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateImageCarouselPayload.swift index 2e5df723..1269afd8 100644 --- a/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateImageCarouselPayload.swift +++ b/LineSDK/LineSDK/Messaging/Model/Template/Payloads/TemplateImageCarouselPayload.swift @@ -55,7 +55,7 @@ public struct TemplateImageCarouselPayload: Codable, TemplateMessagePayloadTypeC } } - let type = TemplateMessagePayloadType.imageCarousel + private(set) var type = TemplateMessagePayloadType.imageCarousel /// Array of columns. You could set at most 10 columns in the payload. Line SDK does not check the elements count /// in a payload. However, it would cause an API response error if more columns contained in the payload.