static void PatchGames(string rootPath) { var patcher = Patcher.Load(Path.Combine(rootPath, "games_v1.json")); // Remove deprecated enum value that causes duplicate C# enum value. patcher.Remove("resources.players.methods.list.parameters.collection.enum[1]", "'playedWith'", "'played_with'"); patcher.Remove("resources.players.methods.list.parameters.collection.enumDescriptions[1]", "'(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.'", "'Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.'"); patcher.SaveWithBackup(); }
static void PatchGames(string rootPath) { var patcher = Patcher.Load(Path.Combine(rootPath, "games_v1.json")); // Remove deprecated enum value that causes duplicate C# enum value. patcher.Remove("resources.players.methods.list.parameters.collection.enum[2]", "'playedWith'", "'played_with'"); // There are now two descriptions that look the same. We just want to remove the first of them. patcher.Remove("resources.players.methods.list.parameters.collection.enumDescriptions[2]", "'(DEPRECATED) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.'", "'(DEPRECATED) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.'"); patcher.SaveWithBackup(); }
static void PatchDirectory(string rootPath) { var patcher = Patcher.Load(Path.Combine(rootPath, "admin_directory_v1.json")); // Strongly-type properties that are defined without typing. patcher.Replace("schemas.User.properties.addresses", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserAddress' } }"); patcher.Replace("schemas.User.properties.emails", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserEmail' } }"); patcher.Replace("schemas.User.properties.externalIds", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserExternalId' } }"); patcher.Replace("schemas.User.properties.ims", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserIm' } }"); patcher.Replace("schemas.User.properties.organizations", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserOrganization' } }"); patcher.Replace("schemas.User.properties.phones", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserPhone' } }"); patcher.Replace("schemas.User.properties.relations", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserRelation' } }"); patcher.Replace("schemas.User.properties.websites", "{ 'type': 'any' }", "{ 'type': 'array', 'items': { '$ref': 'UserWebsite' } }"); patcher.Replace("schemas.Aliases.properties.aliases.items", "{ 'type': 'any' }", "{ '$ref': 'Alias' }"); patcher.SaveWithBackup(); }
static void PatchDataLabeling(string rootPath) { var patcher = IfFileExists(() => Patcher.Load(Path.Combine(rootPath, "datalabeling_v1beta1.json"))); if (patcher is null) { return; } // This just increases the length of one parameter description by adding spaces // so that text wrapping doens't interfere with EOL markers when generating. patcher.Replace( "resources.projects.resources.datasets.resources.annotatedDatasets.resources.feedbackThreads.resources.feedbackMessages.methods.get.parameters.name.description", "'Required. Name of the feedback. Format: &projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}/feedbackMessages/{feedback_message_id}&.'", "'Required. Name of the feedback. Format: &projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset_id}/feedbackThreads/{feedback_thread_id}/feedbackMessages/{feedback_message_id}&.'"); patcher.SaveWithBackup(); }
static void PatchDirectory(string rootPath) { var patcher = IfFileExists(() => Patcher.Load(Path.Combine(rootPath, "admin_directory_v1.json"))); if (patcher is null) { return; } // Strongly-type properties that are defined without typing. patcher.Replace("schemas.User.properties.addresses", "{ 'type': 'any', 'description': 'A list of the user&s addresses. The maximum allowed data size for this field is 10Kb.'}", "{ 'type': 'array', 'items': { '$ref': 'UserAddress' }, 'description': 'A list of the user&s addresses. The maximum allowed data size for this field is 10Kb.' }"); patcher.Replace("schemas.User.properties.emails", "{ 'type': 'any', 'description': 'A list of the user&s email addresses. The maximum allowed data size for this field is 10Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserEmail' }, 'description': 'A list of the user&s email addresses. The maximum allowed data size for this field is 10Kb.' }"); patcher.Replace("schemas.User.properties.externalIds", "{ 'type': 'any', 'description': 'A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserExternalId' }, 'description': 'A list of external IDs for the user, such as an employee or network ID. The maximum allowed data size for this field is 2Kb.' }"); patcher.Replace("schemas.User.properties.ims", "{ 'type': 'any', 'description': 'The user&s Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserIm' }, 'description': 'The user&s Instant Messenger (IM) accounts. A user account can have multiple ims properties. But, only one of these ims properties can be the primary IM contact. The maximum allowed data size for this field is 2Kb.' }"); patcher.Replace("schemas.User.properties.organizations", "{ 'type': 'any', 'description': 'A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserOrganization' }, 'description': 'A list of organizations the user belongs to. The maximum allowed data size for this field is 10Kb.' }"); patcher.Replace("schemas.User.properties.phones", "{ 'type': 'any', 'description': 'A list of the user&s phone numbers. The maximum allowed data size for this field is 1Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserPhone' }, 'description': 'A list of the user&s phone numbers. The maximum allowed data size for this field is 1Kb.' }"); patcher.Replace("schemas.User.properties.relations", "{ 'type': 'any', 'description': 'A list of the user&s relationships to other users. The maximum allowed data size for this field is 2Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserRelation' }, 'description': 'A list of the user&s relationships to other users. The maximum allowed data size for this field is 2Kb.' }"); patcher.Replace("schemas.User.properties.websites", "{ 'type': 'any', 'description': 'The user&s websites. The maximum allowed data size for this field is 2Kb.' }", "{ 'type': 'array', 'items': { '$ref': 'UserWebsite' }, 'description': 'The user&s websites. The maximum allowed data size for this field is 2Kb.' }"); patcher.Replace("schemas.Aliases.properties.aliases.items", "{ 'type': 'any' }", "{ '$ref': 'Alias' }"); patcher.SaveWithBackup(); }
static void PatchDirectory(string rootPath) { var patcher = IfFileExists(() => Patcher.Load(Path.Combine(rootPath, "admin_directory_v1.json"))); if (patcher is null) { return; } // Strongly-type properties that are defined without typing. patcher.Replace("schemas.User.properties.addresses", "{ 'type': 'any', 'description': 'Addresses of User'}", "{ 'type': 'array', 'items': { '$ref': 'UserAddress' }, 'description': 'Addresses of User' }"); patcher.Replace("schemas.User.properties.emails", "{ 'type': 'any', 'description': 'Emails of User' }", "{ 'type': 'array', 'items': { '$ref': 'UserEmail' }, 'description': 'Emails of User' }"); patcher.Replace("schemas.User.properties.externalIds", "{ 'type': 'any', 'description': 'The external Ids of User *' }", "{ 'type': 'array', 'items': { '$ref': 'UserExternalId' }, 'description': 'The external Ids of User *' }"); patcher.Replace("schemas.User.properties.ims", "{ 'type': 'any', 'description': 'User&s Instant Messenger' }", "{ 'type': 'array', 'items': { '$ref': 'UserIm' }, 'description': 'User&s Instant Messenger' }"); patcher.Replace("schemas.User.properties.organizations", "{ 'type': 'any', 'description': 'Organizations of User' }", "{ 'type': 'array', 'items': { '$ref': 'UserOrganization' }, 'description': 'Organizations of User' }"); patcher.Replace("schemas.User.properties.phones", "{ 'type': 'any', 'description': 'Phone numbers of User' }", "{ 'type': 'array', 'items': { '$ref': 'UserPhone' }, 'description': 'Phone numbers of User' }"); patcher.Replace("schemas.User.properties.relations", "{ 'type': 'any', 'description': 'The Relations of User *' }", "{ 'type': 'array', 'items': { '$ref': 'UserRelation' }, 'description': 'The Relations of User *' }"); patcher.Replace("schemas.User.properties.websites", "{ 'type': 'any', 'description': 'Websites of User' }", "{ 'type': 'array', 'items': { '$ref': 'UserWebsite' }, 'description': 'Websites of User' }"); patcher.Replace("schemas.Aliases.properties.aliases.items", "{ 'type': 'any' }", "{ '$ref': 'Alias' }"); patcher.SaveWithBackup(); }