8000 PM-15107: Fix JSON decoding errors for ProfileOrganizationResponseModels and ConfigResponseModel by matt-livefront · Pull Request #1162 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PM-15107: Fix JSON decoding errors for ProfileOrganizationResponseModels and ConfigResponseModel #1162

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

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ServerConfig: Equatable, Codable, Sendable {
let featureStates: [FeatureFlag: AnyCodable]

/// The git hash of the server.
let gitHash: String
let gitHash: String?

/// Third party server information.
let server: ThirdPartyServerConfig?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct ConfigResponseModel: Equatable, JSONResponse {
let featureStates: [String: AnyCodable]?

/// The git hash of the server.
let gitHash: String
let gitHash: String?

/// Third party server information.
let server: ThirdPartyConfigResponseModel?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,90 +5,32 @@ import Foundation
extension ProfileOrganizationResponseModel {
static func fixture(
enabled: Bool = true,
familySponsorshipAvailable: Bool = false,
familySponsorshipFriendlyName: String? = nil,
familySponsorshipLastSyncDate: Date? = nil,
familySponsorshipToDelete: Bool? = nil,
familySponsorshipValidUntil: Date? = nil,
hasPublicAndPrivateKeys: Bool = true,
id: String = "profile-organization-1",
identifier: String? = nil,
key: String? = nil,
keyConnectorEnabled: Bool = false,
keyConnectorUrl: String? = nil,
maxCollections: Int? = nil,
maxStorageGb: Int? = nil,
name: String? = "",
permissions: Permissions? = nil,
planProductType: Int? = nil,
providerId: String? = nil,
providerName: String? = nil,
providerType: Int? = nil,
resetPasswordEnrolled: Bool = false,
seats: Int? = nil,
selfHost: Bool = false,
ssoBound: Bool = false,
status: OrganizationUserStatusType = .confirmed,
type: OrganizationUserType = .user,
use2fa: Bool = false,
useActivateAutofillPolicy: Bool = false,
useApi: Bool = false,
useCustomPermissions: Bool = false,
useDirectory: Bool = false,
useEvents: Bool = false,
useGroups: Bool = false,
useKeyConnector: Bool = false,
usePolicies: Bool = false,
useResetPassword: Bool = false,
useScim: Bool = false,
useSecretsManager: Bool = false,
useSso: Bool = false,
useTotp: Bool = false,
userId: String? = nil,
usersGetPremium: Bool = false
) -> ProfileOrganizationResponseModel {
self.init(
enabled: enabled,
familySponsorshipAvailable: familySponsorshipAvailable,
familySponsorshipFriendlyName: familySponsorshipFriendlyName,
familySponsorshipLastSyncDate: familySponsorshipLastSyncDate,
familySponsorshipToDelete: familySponsorshipToDelete,
familySponsorshipValidUntil: familySponsorshipValidUntil,
hasPublicAndPrivateKeys: hasPublicAndPrivateKeys,
id: id,
identifier: identifier,
key: key,
keyConnectorEnabled: keyConnectorEnabled,
keyConnectorUrl: keyConnectorUrl,
maxCollections: maxCollections,
maxStorageGb: maxStorageGb,
name: name,
permissions: permissions,
planProductType: planProductType,
providerId: providerId,
providerName: providerName,
providerType: providerType,
resetPasswordEnrolled: resetPasswordEnrolled,
seats: seats,
selfHost: selfHost,
ssoBound: ssoBound,
status: status,
type: type,
use2fa: use2fa,
useActivateAutofillPolicy: useActivateAutofillPolicy,
useApi: useApi,
useCustomPermissions: useCustomPermissions,
useDirectory: useDirectory,
useEvents: useEvents,
useGroups: useGroups,
useKeyConnector: useKeyConnector,
usePolicies: usePolicies,
useResetPassword: useResetPassword,
useScim: useScim,
useSecretsManager: useSecretsManager,
useSso: useSso,
useTotp: useTotp,
userId: userId,
usersGetPremium: usersGetPremium
)
}
Expand Down
5DA1
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,6 @@ struct ProfileOrganizationResponseModel: Codable, Equatable {
/// Whether the profile organization is enabled.
let enabled: Bool

/// Whether the profile organization has family sponsorship available.
let familySponsorshipAvailable: Bool

/// The profile organization family sponsorship name.
let familySponsorshipFriendlyName: String?

/// The profile organization family sponsorship last sync date.
let familySponsorshipLastSyncDate: Date?

/// The profile organization family sponsorship name.
let familySponsorshipToDelete: Bool?

/// The profile organization family sponsorship name.
let familySponsorshipValidUntil: Date?

/// Whether the profile organization has public and private keys.
let hasPublicAndPrivateKeys: Bool

/// The profile organization's identifier.
let id: String

Expand All @@ -41,93 +23,24 @@ struct ProfileOrganizationResponseModel: Codable, Equatable {
/// The key connector URL for the profile organization.
let keyConnectorUrl: String?

/// The maximum number of collections for the profile organization.
let maxCollections: Int?

/// The maximum storage amount for the profile organization.
let maxStorageGb: Int?

/// The profile organization's name.
let name: String?

/// The profile organization's permissions.
let permissions: Permissions?

/// The profile organization's plan product.
let planProductType: Int?

/// The profile organization's provider identifier.
let providerId: String?

/// The profile organization's provider name.
let providerName: String?

/// The profile organization's provider type.
let providerType: Int?

/// Whether the profile organization is enrolled.
let resetPasswordEnrolled: Bool

/// The profile organization's number of seats.
let seats: Int?

/// Whether the profile organization is self-hosted.
let selfHost: Bool

/// Whether the profile organization is SSO bound.
let ssoBound: Bool

/// The profile's organization's status.
let status: OrganizationUserStatusType

/// The profile's organization's type.
let type: OrganizationUserType

/// Whether the profile organization uses 2FA.
let use2fa: Bool

/// Whether the profile organization uses the activate autofill policy.
let useActivateAutofillPolicy: Bool

/// Whether the profile organization uses the API.
let useApi: Bool

/// Whether the profile organization uses custom permissions.
let useCustomPermissions: Bool

/// Whether the profile organization uses directory.
let useDirectory: Bool

/// Whether the profile organization uses events.
let useEvents: Bool

/// Whether the profile organization uses groups.
let useGroups: Bool

/// Whether the profile organization uses key connector.
let useKeyConnector: Bool

/// Whether the profile organization uses policies.
let usePolicies: Bool

/// Whether the profile organization uses reset password.
let useResetPassword: Bool

/// Whether the profile organization uses SCIM.
let useScim: Bool

/// Whether the profile organization uses the secrets manager.
let useSecretsManager: Bool

/// Whether the profile organization uses SSO.
let useSso: Bool

/// Whether the profile organization uses TOTP.
let useTotp: Bool

/// The profile organization's user identifier.
let userId: String?

/// Whether the profile organization's users get premium.
let usersGetPremium: Bool
}
Expand Down
Loading
0