|
| 1 | +// |
| 2 | +// ContentstackMessages.swift |
| 3 | +// Contentstack |
| 4 | +// |
| 5 | +// Created by Contentstack on 16/12/25. |
| 6 | +// |
| 7 | + |
| 8 | +import Foundation |
| 9 | + |
| 10 | +/// Centralized location for all user-facing messages in the Contentstack SDK. |
| 11 | +/// This includes error messages, validation messages, and informational messages. |
| 12 | +internal enum ContentstackMessages { |
| 13 | + |
| 14 | + // MARK: - UID Required Messages |
| 15 | + |
| 16 | + static let assetUIDRequired = "Asset UID is required. Provide a valid Asset UID and try again." |
| 17 | + static let contentTypeUIDRequired = "Content Type UID is required. Provide a valid Content Type UID and try again." |
| 18 | + static let entryUIDRequired = "Entry UID is required. Provide a valid Entry UID and try again." |
| 19 | + static let globalFieldUIDRequired = "Global Field UID is required. Provide a valid Global Field UID and try again." |
| 20 | + |
| 21 | + // MARK: - URL Validation Messages |
| 22 | + |
| 23 | + static let invalidURLString = "The URL string is not valid. Provide a valid URL and try again." |
| 24 | + |
| 25 | + // MARK: - Sync Messages |
| 26 | + |
| 27 | + static let syncTokenConflict = "Sync Token and Pagination Token cannot be used together. Provide only one token and try again." |
| 28 | + |
| 29 | + // MARK: - Image Transform Messages |
| 30 | + |
| 31 | + static let qualityParameterRange = """ |
| 32 | + The value for Quality parameters can be entered in \ |
| 33 | + any whole number (taken as a percentage) between 1 and 100. |
| 34 | + """ |
| 35 | + |
| 36 | + static let dprParameterRange = """ |
| 37 | + The value for dpr parameter could be a whole number (between 0 and 10000) \ |
| 38 | + or any decimal number (between 0.0 and 9999.9999...). |
| 39 | + """ |
| 40 | + |
| 41 | + static let blurParameterRange = """ |
| 42 | + The value for blur parameter could be a whole decimal number (between 1 and 1000). |
| 43 | + """ |
| 44 | + |
| 45 | + static let saturationParameterRange = """ |
| 46 | + The value for saturation parameter could be a whole decimal number (between -100 and 100). |
| 47 | + """ |
| 48 | + |
| 49 | + static let contrastParameterRange = """ |
| 50 | + The value for contrast parameter could be a whole decimal number (between -100 and 100). |
| 51 | + """ |
| 52 | + |
| 53 | + static let brightnessParameterRange = """ |
| 54 | + The value for brightness parameter could be a whole decimal number (between -100 and 100). |
| 55 | + """ |
| 56 | + |
| 57 | + static let sharpenParameterRange = """ |
| 58 | + The value for `amount` parameter could be a whole decimal number (between 0 and 10). \ |
| 59 | + The value for `radius` parameter could be a whole decimal number (between 1 and 1000). \ |
| 60 | + The value for `threshold` parameter could be a whole decimal number (between 0 and 255). |
| 61 | + """ |
| 62 | + |
| 63 | + static let cropAspectRatioRequired = """ |
| 64 | + Along with the crop parameter aspect-ration, \ |
| 65 | + you also need to specify either the width or height parameter or both \ |
| 66 | + in the API request to return an output image with the correct dimensions. |
| 67 | + """ |
| 68 | + |
| 69 | + static let canvasAspectRatioRequired = """ |
| 70 | + Along with the canvas parameter aspect-ration, \ |
| 71 | + you also need to specify either the width or height parameter or both \ |
| 72 | + in the API request to return an output image with the correct dimensions. |
| 73 | + """ |
| 74 | + |
| 75 | + static let invalidHexColor = """ |
| 76 | + Invalid Hexadecimal value, \ |
| 77 | + it should be 3-digit or 6-digit hexadecimal value. |
| 78 | + """ |
| 79 | + |
| 80 | + static let invalidRGBColor = """ |
| 81 | + Invalid Red or Blue or Green or alpha value, \ |
| 82 | + the value ranging anywhere between 0 and 255 for each. |
| 83 | + """ |
| 84 | + |
| 85 | + static let invalidRGBAColor = """ |
| 86 | + Invalid Red or Blue or Green or alpha value, \ |
| 87 | + the value ranging anywhere between 0 and 255 for each \ |
| 88 | + and the alpha value with 0.0 being fully transparent \ |
| 89 | + and 1.0 being completely opaque. |
| 90 | + """ |
| 91 | + |
| 92 | + static let duplicateImageTransform = """ |
| 93 | + Cannot specify two instances of ImageTransform of the same case.\ |
| 94 | + i.e. `[.format(.png), .format(.jpg)]` is invalid. |
| 95 | + """ |
| 96 | + |
| 97 | + static let invalidImageOptions = """ |
| 98 | + The SDK was unable to generate a valid URL for the given ImageOptions. \ |
| 99 | + Please contact the maintainer on Github with a copy of the query |
| 100 | + """ |
| 101 | + |
| 102 | + // MARK: - Internal/Debug Messages |
| 103 | + |
| 104 | + static let unsupportedEndpointType = "Unsupported endpoint type encountered during response decoding" |
| 105 | +} |
| 106 | + |
0 commit comments