diff --git a/include/wolfram/atproto_lex.h b/include/wolfram/atproto_lex.h index c6551d5..010a83e 100644 --- a/include/wolfram/atproto_lex.h +++ b/include/wolfram/atproto_lex.h @@ -352,7 +352,7 @@ typedef struct wf_lex_blob { const char *cid; const char *mime_type; int64_t siz #define WF_LEX_APP_BSKY_GRAPH_GET_LISTS_WITH_MEMBERSHIP_NSID "app.bsky.graph.getListsWithMembership" #define WF_LEX_APP_BSKY_GRAPH_GET_LISTS_WITH_MEMBERSHIP_KIND "query" -/** Enumerates accounts that the requesting account (actor) currently has muted. Requires auth. */ +/** Enumerates accounts that the requesting account (actor) currently has fully muted. Mutes scoped to specific kinds of content (only reposts, only quote posts) are not included. Responses may contain more items than the requested limit. Requires auth. */ #define WF_LEX_APP_BSKY_GRAPH_GET_MUTES_NSID "app.bsky.graph.getMutes" #define WF_LEX_APP_BSKY_GRAPH_GET_MUTES_KIND "query" @@ -388,7 +388,7 @@ typedef struct wf_lex_blob { const char *cid; const char *mime_type; int64_t siz #define WF_LEX_APP_BSKY_GRAPH_LISTITEM_NSID "app.bsky.graph.listitem" #define WF_LEX_APP_BSKY_GRAPH_LISTITEM_KIND "record" -/** Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth. */ +/** Creates a mute relationship for the specified account. If a mute already exists for the account, it is updated in place: the stored scope is replaced with the scope in this request. Mutes are private in Bluesky. Requires auth. */ #define WF_LEX_APP_BSKY_GRAPH_MUTE_ACTOR_NSID "app.bsky.graph.muteActor" #define WF_LEX_APP_BSKY_GRAPH_MUTE_ACTOR_KIND "procedure" @@ -1367,7 +1367,7 @@ typedef struct wf_lex_blob { const char *cid; const char *mime_type; int64_t siz #define WF_LEX_TOOLS_OZONE_QUEUE_UNASSIGN_MODERATOR_NSID "tools.ozone.queue.unassignModerator" #define WF_LEX_TOOLS_OZONE_QUEUE_UNASSIGN_MODERATOR_KIND "procedure" -/** Update queue properties. Currently only supports updating the name and enabled status to prevent configuration conflicts. */ +/** Update queue properties. */ #define WF_LEX_TOOLS_OZONE_QUEUE_UPDATE_QUEUE_NSID "tools.ozone.queue.updateQueue" #define WF_LEX_TOOLS_OZONE_QUEUE_UPDATE_QUEUE_KIND "procedure" @@ -4046,8 +4046,15 @@ typedef struct wf_lex_app_bsky_actor_defs_profile_associated_activity_subscripti /** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */ typedef struct wf_lex_app_bsky_actor_defs_viewer_state { + /** Whether the account is fully muted, directly or via a mutelist. False when the mute is scoped to specific kinds; see mutedOnlyReposts and mutedOnlyQuoteposts. */ bool has_muted; bool muted; + /** Whether the account's reposts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false. */ + bool has_muted_only_reposts; + bool muted_only_reposts; + /** Whether the account's quote posts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false. */ + bool has_muted_only_quoteposts; + bool muted_only_quoteposts; bool has_muted_by_list; const wf_lex_app_bsky_graph_defs_list_view_basic * muted_by_list; bool has_blocked_by; @@ -6208,6 +6215,12 @@ typedef struct wf_lex_app_bsky_graph_listitem_main { typedef struct wf_lex_app_bsky_graph_mute_actor_main_input { const char * actor; + /** Restrict the mute to the account's reposts. When any 'only' scope is set, just the scoped content is muted; when none are set, the account is fully muted. Repeat calls replace the stored scope rather than adding to it. */ + bool has_only_reposts; + bool only_reposts; + /** Restrict the mute to the account's quote posts. See onlyReposts. */ + bool has_only_quoteposts; + bool only_quoteposts; } wf_lex_app_bsky_graph_mute_actor_main_input; typedef struct wf_lex_app_bsky_graph_mute_actor_list_main_input { @@ -6649,8 +6662,14 @@ typedef struct wf_lex_app_bsky_unspecced_defs_thread_item_post { bool more_parents; /** This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. */ int64_t more_replies; - /** This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. */ + /** This post is part of a contiguous thread by the OP from the thread root. Sub-threads by OP deeper in the tree are not considered an OP thread. */ bool op_thread; + /** The 1-indexed position of this post within the contiguous OP thread. Only present when this post is part of the OP thread (see `opThread`). */ + bool has_op_thread_post_index; + int64_t op_thread_post_index; + /** The total number of posts in the contiguous OP thread that this post belongs to. Only present when this post is part of the OP thread (see `opThread`). */ + bool has_op_thread_post_count; + int64_t op_thread_post_count; /** The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. */ bool hidden_by_threadgate; /** This is by an account muted by the viewer requesting it. */ @@ -8027,6 +8046,7 @@ typedef struct wf_lex_chat_bsky_group_approve_join_request_main_output { } wf_lex_chat_bsky_group_approve_join_request_main_output; typedef struct wf_lex_chat_bsky_group_create_group_main_input { + /** The members to add to the group. The owner is automatically added. Implementations may enforce a lower maximum than the 10,000-item schema limit; Bluesky currently supports up to 100 total members. If the owner is included in this list, the list may contain up to the implementation's total member limit. Otherwise, it may contain one fewer. */ WF_LEX_ARRAY(const char *) members; const char * name; } wf_lex_chat_bsky_group_create_group_main_input; @@ -11193,6 +11213,9 @@ typedef struct wf_lex_tools_ozone_queue_create_queue_main_input { /** Optional description of the queue */ bool has_description; const char * description; + /** Policy keys to recommend when actioning reports in this queue */ + bool has_recommended_policies; + WF_LEX_ARRAY(const char *) recommended_policies; } wf_lex_tools_ozone_queue_create_queue_main_input; typedef struct wf_lex_tools_ozone_queue_create_queue_main_output { @@ -11216,6 +11239,9 @@ typedef struct wf_lex_tools_ozone_queue_defs_queue_view { /** Optional description of the queue */ bool has_description; const char * description; + /** Policy keys recommended when actioning reports in this queue */ + bool has_recommended_policies; + WF_LEX_ARRAY(const char *) recommended_policies; /** DID of moderator who created this queue */ const char * created_by; const char * created_at; @@ -11360,6 +11386,9 @@ typedef struct wf_lex_tools_ozone_queue_update_queue_main_input { /** Optional description of the queue */ bool has_description; const char * description; + /** Policy keys to recommend when actioning reports in this queue */ + bool has_recommended_policies; + WF_LEX_ARRAY(const char *) recommended_policies; } wf_lex_tools_ozone_queue_update_queue_main_input; typedef struct wf_lex_tools_ozone_queue_update_queue_main_output { diff --git a/lexicons/app/bsky/actor/defs.json b/lexicons/app/bsky/actor/defs.json index fa9588e..195fb37 100644 --- a/lexicons/app/bsky/actor/defs.json +++ b/lexicons/app/bsky/actor/defs.json @@ -195,7 +195,18 @@ "type": "object", "description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", "properties": { - "muted": { "type": "boolean" }, + "muted": { + "type": "boolean", + "description": "Whether the account is fully muted, directly or via a mutelist. False when the mute is scoped to specific kinds; see mutedOnlyReposts and mutedOnlyQuoteposts." + }, + "mutedOnlyReposts": { + "type": "boolean", + "description": "Whether the account's reposts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false." + }, + "mutedOnlyQuoteposts": { + "type": "boolean", + "description": "Whether the account's quote posts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false." + }, "mutedByList": { "type": "ref", "ref": "app.bsky.graph.defs#listViewBasic" diff --git a/lexicons/app/bsky/graph/getMutes.json b/lexicons/app/bsky/graph/getMutes.json index 22eaf0d..014ff7f 100644 --- a/lexicons/app/bsky/graph/getMutes.json +++ b/lexicons/app/bsky/graph/getMutes.json @@ -4,7 +4,7 @@ "defs": { "main": { "type": "query", - "description": "Enumerates accounts that the requesting account (actor) currently has muted. Requires auth.", + "description": "Enumerates accounts that the requesting account (actor) currently has fully muted. Mutes scoped to specific kinds of content (only reposts, only quote posts) are not included. Responses may contain more items than the requested limit. Requires auth.", "parameters": { "type": "params", "properties": { diff --git a/lexicons/app/bsky/graph/muteActor.json b/lexicons/app/bsky/graph/muteActor.json index c2bf09a..e8f85be 100644 --- a/lexicons/app/bsky/graph/muteActor.json +++ b/lexicons/app/bsky/graph/muteActor.json @@ -4,14 +4,22 @@ "defs": { "main": { "type": "procedure", - "description": "Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth.", + "description": "Creates a mute relationship for the specified account. If a mute already exists for the account, it is updated in place: the stored scope is replaced with the scope in this request. Mutes are private in Bluesky. Requires auth.", "input": { "encoding": "application/json", "schema": { "type": "object", "required": ["actor"], "properties": { - "actor": { "type": "string", "format": "at-identifier" } + "actor": { "type": "string", "format": "at-identifier" }, + "onlyReposts": { + "type": "boolean", + "description": "Restrict the mute to the account's reposts. When any 'only' scope is set, just the scoped content is muted; when none are set, the account is fully muted. Repeat calls replace the stored scope rather than adding to it." + }, + "onlyQuoteposts": { + "type": "boolean", + "description": "Restrict the mute to the account's quote posts. See onlyReposts." + } } } } diff --git a/lexicons/app/bsky/unspecced/defs.json b/lexicons/app/bsky/unspecced/defs.json index 5ec112d..3dd830a 100644 --- a/lexicons/app/bsky/unspecced/defs.json +++ b/lexicons/app/bsky/unspecced/defs.json @@ -111,7 +111,15 @@ }, "opThread": { "type": "boolean", - "description": "This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread." + "description": "This post is part of a contiguous thread by the OP from the thread root. Sub-threads by OP deeper in the tree are not considered an OP thread." + }, + "opThreadPostIndex": { + "type": "integer", + "description": "The 1-indexed position of this post within the contiguous OP thread. Only present when this post is part of the OP thread (see `opThread`)." + }, + "opThreadPostCount": { + "type": "integer", + "description": "The total number of posts in the contiguous OP thread that this post belongs to. Only present when this post is part of the OP thread (see `opThread`)." }, "hiddenByThreadgate": { "type": "boolean", diff --git a/lexicons/chat/bsky/group/createGroup.json b/lexicons/chat/bsky/group/createGroup.json index 6a08e9d..db5c975 100644 --- a/lexicons/chat/bsky/group/createGroup.json +++ b/lexicons/chat/bsky/group/createGroup.json @@ -22,7 +22,8 @@ "properties": { "members": { "type": "array", - "maxLength": 49, + "description": "The members to add to the group. The owner is automatically added. Implementations may enforce a lower maximum than the 10,000-item schema limit; Bluesky currently supports up to 100 total members. If the owner is included in this list, the list may contain up to the implementation's total member limit. Otherwise, it may contain one fewer.", + "maxLength": 10000, "items": { "type": "string", "format": "did" diff --git a/lexicons/tools/ozone/queue/createQueue.json b/lexicons/tools/ozone/queue/createQueue.json index 8198f0a..38a4945 100644 --- a/lexicons/tools/ozone/queue/createQueue.json +++ b/lexicons/tools/ozone/queue/createQueue.json @@ -39,6 +39,11 @@ "description": { "type": "string", "description": "Optional description of the queue" + }, + "recommendedPolicies": { + "type": "array", + "items": { "type": "string" }, + "description": "Policy keys to recommend when actioning reports in this queue" } } } @@ -57,6 +62,10 @@ } }, "errors": [ + { + "name": "InvalidRecommendedPolicies", + "description": "One or more recommended policy keys do not exist in the configured policy list" + }, { "name": "ConflictingQueue", "description": "The queue configuration conflicts with an existing queue" diff --git a/lexicons/tools/ozone/queue/defs.json b/lexicons/tools/ozone/queue/defs.json index 07c8ca4..9c2aa16 100644 --- a/lexicons/tools/ozone/queue/defs.json +++ b/lexicons/tools/ozone/queue/defs.json @@ -46,6 +46,11 @@ "type": "string", "description": "Optional description of the queue" }, + "recommendedPolicies": { + "type": "array", + "items": { "type": "string" }, + "description": "Policy keys recommended when actioning reports in this queue" + }, "createdBy": { "type": "string", "format": "did", diff --git a/lexicons/tools/ozone/queue/updateQueue.json b/lexicons/tools/ozone/queue/updateQueue.json index a813f42..757bd64 100644 --- a/lexicons/tools/ozone/queue/updateQueue.json +++ b/lexicons/tools/ozone/queue/updateQueue.json @@ -4,7 +4,7 @@ "defs": { "main": { "type": "procedure", - "description": "Update queue properties. Currently only supports updating the name and enabled status to prevent configuration conflicts.", + "description": "Update queue properties.", "input": { "encoding": "application/json", "schema": { @@ -26,6 +26,11 @@ "description": { "type": "string", "description": "Optional description of the queue" + }, + "recommendedPolicies": { + "type": "array", + "items": { "type": "string" }, + "description": "Policy keys to recommend when actioning reports in this queue" } } } @@ -42,7 +47,13 @@ } } } - } + }, + "errors": [ + { + "name": "InvalidRecommendedPolicies", + "description": "One or more recommended policy keys do not exist in the configured policy list" + } + ] } } } diff --git a/src/atproto_lex.c b/src/atproto_lex.c index 6d97c5d..678c6a1 100644 --- a/src/atproto_lex.c +++ b/src/atproto_lex.c @@ -3235,6 +3235,20 @@ static wf_status wf_lex_encode_wf_lex_app_bsky_graph_mute_actor_main_input(const if (!item) goto fail; if (!item || !cJSON_AddItemToObject(root, "actor", item)) { cJSON_Delete(item); item = NULL; goto fail; } item = NULL; + if (value->has_only_reposts) { + item = NULL; + item = cJSON_CreateBool(value->only_reposts); + if (!item) goto fail; + if (!item || !cJSON_AddItemToObject(root, "onlyReposts", item)) { cJSON_Delete(item); item = NULL; goto fail; } + item = NULL; + } + if (value->has_only_quoteposts) { + item = NULL; + item = cJSON_CreateBool(value->only_quoteposts); + if (!item) goto fail; + if (!item || !cJSON_AddItemToObject(root, "onlyQuoteposts", item)) { cJSON_Delete(item); item = NULL; goto fail; } + item = NULL; + } *out = root; return WF_OK; invalid: cJSON_Delete(item); cJSON_Delete(root); return WF_ERR_INVALID_ARG; @@ -6772,6 +6786,23 @@ static wf_status wf_lex_encode_wf_lex_tools_ozone_queue_create_queue_main_input( if (!item || !cJSON_AddItemToObject(root, "description", item)) { cJSON_Delete(item); item = NULL; goto fail; } item = NULL; } + if (value->has_recommended_policies) { + item = NULL; + if (value->recommended_policies.count && !value->recommended_policies.items) goto invalid; + item = cJSON_CreateArray(); + if (!item) goto fail; + for (size_t i_recommended_policies = 0; i_recommended_policies < value->recommended_policies.count; ++i_recommended_policies) { + cJSON *element_recommended_policies = NULL; + if (!value->recommended_policies.items[i_recommended_policies]) goto invalid; + element_recommended_policies = cJSON_CreateString(value->recommended_policies.items[i_recommended_policies]); + if (!element_recommended_policies) goto fail; + if (!cJSON_AddItemToArray(item, element_recommended_policies)) { + cJSON_Delete(element_recommended_policies); goto fail; + } + } + if (!item || !cJSON_AddItemToObject(root, "recommendedPolicies", item)) { cJSON_Delete(item); item = NULL; goto fail; } + item = NULL; + } *out = root; return WF_OK; invalid: cJSON_Delete(item); cJSON_Delete(root); return WF_ERR_INVALID_ARG; @@ -6893,6 +6924,23 @@ static wf_status wf_lex_encode_wf_lex_tools_ozone_queue_update_queue_main_input( if (!item || !cJSON_AddItemToObject(root, "description", item)) { cJSON_Delete(item); item = NULL; goto fail; } item = NULL; } + if (value->has_recommended_policies) { + item = NULL; + if (value->recommended_policies.count && !value->recommended_policies.items) goto invalid; + item = cJSON_CreateArray(); + if (!item) goto fail; + for (size_t i_recommended_policies = 0; i_recommended_policies < value->recommended_policies.count; ++i_recommended_policies) { + cJSON *element_recommended_policies = NULL; + if (!value->recommended_policies.items[i_recommended_policies]) goto invalid; + element_recommended_policies = cJSON_CreateString(value->recommended_policies.items[i_recommended_policies]); + if (!element_recommended_policies) goto fail; + if (!cJSON_AddItemToArray(item, element_recommended_policies)) { + cJSON_Delete(element_recommended_policies); goto fail; + } + } + if (!item || !cJSON_AddItemToObject(root, "recommendedPolicies", item)) { cJSON_Delete(item); item = NULL; goto fail; } + item = NULL; + } *out = root; return WF_OK; invalid: cJSON_Delete(item); cJSON_Delete(root); return WF_ERR_INVALID_ARG; @@ -9771,6 +9819,22 @@ static wf_status wf_lex_decode_wf_lex_app_bsky_actor_defs_viewer_state(cJSON *no value->muted = cJSON_IsTrue(member); } } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "mutedOnlyReposts"); + if (member) { + value->has_muted_only_reposts = true; + if (!cJSON_IsBool(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->muted_only_reposts = cJSON_IsTrue(member); + } + } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "mutedOnlyQuoteposts"); + if (member) { + value->has_muted_only_quoteposts = true; + if (!cJSON_IsBool(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->muted_only_quoteposts = cJSON_IsTrue(member); + } + } { cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "mutedByList"); if (member) { @@ -20323,6 +20387,22 @@ static wf_status wf_lex_decode_wf_lex_app_bsky_graph_mute_actor_main_input(cJSON value->actor = wf_lex_strdup(member->valuestring); if (!value->actor) { status = WF_ERR_ALLOC; goto cleanup; } } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "onlyReposts"); + if (member) { + value->has_only_reposts = true; + if (!cJSON_IsBool(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->only_reposts = cJSON_IsTrue(member); + } + } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "onlyQuoteposts"); + if (member) { + value->has_only_quoteposts = true; + if (!cJSON_IsBool(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->only_quoteposts = cJSON_IsTrue(member); + } + } return WF_OK; cleanup: wf_lex_clear_wf_lex_app_bsky_graph_mute_actor_main_input(value); @@ -22947,6 +23027,20 @@ static wf_status wf_lex_decode_wf_lex_app_bsky_unspecced_defs_thread_item_post(c if (!cJSON_IsBool(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } value->op_thread = cJSON_IsTrue(member); } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "opThreadPostIndex"); + if (member) { + value->has_op_thread_post_index = true; + if (!wf_lex_json_integer(member, &value->op_thread_post_index)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + } + } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "opThreadPostCount"); + if (member) { + value->has_op_thread_post_count = true; + if (!wf_lex_json_integer(member, &value->op_thread_post_count)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + } + } { cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "hiddenByThreadgate"); if (!member) { status = WF_ERR_INVALID_ARG; goto cleanup; } @@ -46104,6 +46198,10 @@ static void wf_lex_clear_wf_lex_tools_ozone_queue_create_queue_main_input(wf_lex } free((void *)value->report_types.items); free((void *)value->description); + for (size_t i = 0; i < value->recommended_policies.count; ++i) { + free((void *)value->recommended_policies.items[i]); + } + free((void *)value->recommended_policies.items); memset(value, 0, sizeof(*value)); } @@ -46174,6 +46272,25 @@ static wf_status wf_lex_decode_wf_lex_tools_ozone_queue_create_queue_main_input( if (!value->description) { status = WF_ERR_ALLOC; goto cleanup; } } } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "recommendedPolicies"); + if (member) { + value->has_recommended_policies = true; + if (!cJSON_IsArray(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->recommended_policies.count = (size_t)cJSON_GetArraySize(member); + if (value->recommended_policies.count) { + const char * *items = calloc(value->recommended_policies.count, sizeof(*items)); + if (!items) { status = WF_ERR_ALLOC; goto cleanup; } + value->recommended_policies.items = items; + for (size_t i = 0; i < value->recommended_policies.count; ++i) { + cJSON *element = cJSON_GetArrayItem(member, (int)i); + if (!cJSON_IsString(element)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + items[i] = wf_lex_strdup(element->valuestring); + if (!items[i]) { status = WF_ERR_ALLOC; goto cleanup; } + } + } + } + } return WF_OK; cleanup: wf_lex_clear_wf_lex_tools_ozone_queue_create_queue_main_input(value); @@ -46350,6 +46467,10 @@ static void wf_lex_clear_wf_lex_tools_ozone_queue_defs_queue_view(wf_lex_tools_o } free((void *)value->report_types.items); free((void *)value->description); + for (size_t i = 0; i < value->recommended_policies.count; ++i) { + free((void *)value->recommended_policies.items[i]); + } + free((void *)value->recommended_policies.items); free((void *)value->created_by); free((void *)value->created_at); free((void *)value->updated_at); @@ -46430,6 +46551,25 @@ static wf_status wf_lex_decode_wf_lex_tools_ozone_queue_defs_queue_view(cJSON *n if (!value->description) { status = WF_ERR_ALLOC; goto cleanup; } } } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "recommendedPolicies"); + if (member) { + value->has_recommended_policies = true; + if (!cJSON_IsArray(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->recommended_policies.count = (size_t)cJSON_GetArraySize(member); + if (value->recommended_policies.count) { + const char * *items = calloc(value->recommended_policies.count, sizeof(*items)); + if (!items) { status = WF_ERR_ALLOC; goto cleanup; } + value->recommended_policies.items = items; + for (size_t i = 0; i < value->recommended_policies.count; ++i) { + cJSON *element = cJSON_GetArrayItem(member, (int)i); + if (!cJSON_IsString(element)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + items[i] = wf_lex_strdup(element->valuestring); + if (!items[i]) { status = WF_ERR_ALLOC; goto cleanup; } + } + } + } + } { cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "createdBy"); if (!member) { status = WF_ERR_INVALID_ARG; goto cleanup; } @@ -46877,6 +47017,10 @@ static void wf_lex_clear_wf_lex_tools_ozone_queue_update_queue_main_input(wf_lex if (!value) return; free((void *)value->name); free((void *)value->description); + for (size_t i = 0; i < value->recommended_policies.count; ++i) { + free((void *)value->recommended_policies.items[i]); + } + free((void *)value->recommended_policies.items); memset(value, 0, sizeof(*value)); } @@ -46915,6 +47059,25 @@ static wf_status wf_lex_decode_wf_lex_tools_ozone_queue_update_queue_main_input( if (!value->description) { status = WF_ERR_ALLOC; goto cleanup; } } } + { + cJSON *member = cJSON_GetObjectItemCaseSensitive(node, "recommendedPolicies"); + if (member) { + value->has_recommended_policies = true; + if (!cJSON_IsArray(member)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + value->recommended_policies.count = (size_t)cJSON_GetArraySize(member); + if (value->recommended_policies.count) { + const char * *items = calloc(value->recommended_policies.count, sizeof(*items)); + if (!items) { status = WF_ERR_ALLOC; goto cleanup; } + value->recommended_policies.items = items; + for (size_t i = 0; i < value->recommended_policies.count; ++i) { + cJSON *element = cJSON_GetArrayItem(member, (int)i); + if (!cJSON_IsString(element)) { status = WF_ERR_INVALID_ARG; goto cleanup; } + items[i] = wf_lex_strdup(element->valuestring); + if (!items[i]) { status = WF_ERR_ALLOC; goto cleanup; } + } + } + } + } return WF_OK; cleanup: wf_lex_clear_wf_lex_tools_ozone_queue_update_queue_main_input(value);